Unevenly Time-Stepped Real Number from File format

File Description

The data that TRIM can read in from a file must be as text in row-column format.  There can be comments at the beginning of the file.  However, there must be at least 2 lines of data for TRIM to determine where the data begins and ends. All data must be delimited by the same delimiter in the file. The data must unique contain column names for each column in the file. The column names must be listed on a line before the data begins.

The first column must be called "Date" and contain a date in mm/dd/yyyy format (i.e. 10/13/2000). The second column must be called "Time" and must contain the time that the data becomes valid in hh:mm:ss format (i.e. 13:27:00). The third column must contain the time zone.  After this any number of columns can follow with data in them.

Below is an acceptable file format:

This is an ambient data file that can be read in by the prototype.
Note that these comments appear freely and do not need to be delimited.
They can even contain a few delimiters (, , , ,), but not the same number as the data lines below.

Date,Hour,Time Zone,temperature (K),winddirection , windspeed (ignored if layers defined), precipitation (m/day),stability class,layer1 wind speed (m/s), layer2 wind speed (m),l1 to l2 speed (m/s),layer 1 height (m),layer 2 height (m),night/day

1/1/1991,0,EST,281.0317237,112.7750803,0,0.003082795,4,4.862,7.179,0.047,568,930,1
1/1/1992,0,EST,282.0317237,113.7750803,0.1,0.003082795,5,4.862,7.179,0.047,568,930,1
1/1/1993,0,EST,283.0317237,114.7750803,0.2,0.003082795,6,4.862,7.179,0.047,568,930,1
1/1/1994,0,EST,284.0317237,115.7750803,0.3,0.003082795,7,4.862,7.179,0.047,568,930,1
 

Troubleshooting

TRIM determines where your data begins and ends by scanning the file and counting the number of columns on each line.  When it finds several lines in a row that contain the same number of columns, it will assume that any line with this number of columns is a data line. TRIM will then go back to the top of the file and parse the first line with the correct number of delimiters and assume that these are the column names. If there is a line before your column names that contains the same number of delimiters as a data line, TRIM will use this line and may not read the data correctly. For example, if your comment line has 6 commas in it and your data has 6 commas delimiting the columns, TRIM will use your comment line to find the column names. To correct this, don't allow the same number of delimiters on a comment line as on a data line.

Note that when Excel exports a file to CSV (Comma Separated Variable) format, it places commas between every column. So your exported data may look like this:
 

This is an ambient data file that would confuse the prototype.,,,,,,,,,,,,,

startdata,,,,,,,,,,,,,
format:default,,,,,,,,,,,,,
day,,,,,,,,,,,,,

Date,Hour,Time Zone,temperature (K),winddirection , windspeed (ignored if layers defined), precipitation (m/day),stability class,layer1 wind speed (m/s), layer2 wind speed (m),l1 to l2 speed (m/s),layer 1 height (m),layer 2 height (m),night/day

1/1/1991,0,EST,281.0317237,112.7750803,0,0.003082795,4,4.862,7.179,0.047,568,930,1
1/1/1992,0,EST,281.0317237,112.7750803,0,0.003082795,4,4.862,7.179,0.047,568,930,1
1/1/1992,0,EST,281.0317237,112.7750803,0,0.003082795,4,4.862,7.179,0.047,568,930,1
1/1/1992,0,EST,281.0317237,112.7750803,0,0.003082795,4,4.862,7.179,0.047,568,930,1

The trouble with this file is that Excel has placed extra commas on lines that do not contain data. In fact, there are 13 commas on each data line and 13 commas on the comments lines as well. The solution is to remove the unneeded commas from the comment lines.

If your data file only has one line of data, TRIM will be unable to determine where the data begins and ends. This is because there are too few lines of data for TRIM to decide what number of delimiters denotes a data line. If you only have one or two lines of data, consider using an Unevenly Stepped Real Number property type and typing the data directly into TRIM.