Text processing/2: Difference between revisions
Content added Content deleted
m (ce lead paragraphs) |
|||
Line 2: | Line 2: | ||
The following data shows a few lines from the file readings.txt (as used in the [[Data Munging]] task). |
The following data shows a few lines from the file readings.txt (as used in the [[Data Munging]] task). |
||
The data comes from a pollution monitoring station with twenty four instruments monitoring twenty |
The data comes from a pollution monitoring station with twenty four instruments monitoring twenty-four aspects of pollution in the air. Periodically a record is added to the file, each record being a line of 49 white-space separated fields, where white-space can be one or more space or tab characters. |
||
The fields (from the left) are: |
The fields (from the left) are: |
||
DATESTAMP [ VALUEn FLAGn ] * 24 |
DATESTAMP [ VALUEn FLAGn ] * 24 |
||
i.e. a datestamp followed by twenty four repetitions of a floating |
i.e. a datestamp followed by twenty four repetitions of a floating-point instrument value and that instrument's associated integer flag. Flag values are >= 1 if the instrument is working and < 1 if there is some problem with that instrument, in which case that instrument's value should be ignored. |
||
A sample from the full data file [http://rosettacode.org/resources/readings.zip readings.txt] is: |
A sample from the full data file [http://rosettacode.org/resources/readings.zip readings.txt] is: |
||
Line 19: | Line 19: | ||
The task: |
The task: |
||
# Confirm the general field format of the file |
# Confirm the general field format of the file. |
||
# Identify any DATESTAMPs that are duplicated. |
# Identify any DATESTAMPs that are duplicated. |
||
# |
# Report the number of records have good readings for all instruments. |
||
=={{header|Ada}}== |
=={{header|Ada}}== |