JP All American 16807 Posts user info edit post |
I'm trying to read a text file, sort of like the one found here:
http://weather.uwyo.edu/cgi-bin/sounding?region=naconf&TYPE=TEXT%3ALIST&YEAR=2006&MONTH=06&FROM=0212&TO=0212&STNM=72327
The only thing is, when I read it in MATLAB, it will not read the columns right, i.e. the first row temperature value is actually the second row's pressure value (hopefully you can follow by looking at the link).
The bottom lin eis I have hundreds of files to read and do not want to go through each one just to put 'NaN' in the missing values places. Any help would be fantastic!! 6/2/2006 1:18:25 PM |
clalias All American 1580 Posts user info edit post |
hmmm, I think you are going to have to write a script using c-style commands. fread,scanstr etc...
It wouldn't be too bad if all the data files have missing data on the first line only. But I doubt that's the case. Your data files have missing data points randomly in the data, right?
Maybe someone on here could write a quick perl code to, for example, change to comma delimiter then transform your data to look like,
1000.0,114,,,,,,,,, 993.0,210,18.8,18.6,99,13.77,175,3,292.5,331.8,294.9
Then you could get matlab to fill in NaN really easily.
[Edited on June 2, 2006 at 2:15 PM. Reason : .]
[Edited on June 2, 2006 at 2:15 PM. Reason : .] 6/2/2006 2:14:49 PM |