Extracting column from text file
Mostra commenti meno recenti
The NOAA atmospheric data file with the entries defined by the header row comes in the following format:
USAF WBAN STATION NAME CTRY ST CALL LAT LON ELEV(M) BEGIN END
007018 99999 WXPOD 7018 +00.000 +000.000 +7018.0 20110309 20130730
007026 99999 WXPOD 7026 AF +00.000 +000.000 +7026.0 20120713 20170822
007070 99999 WXPOD 7070 AF +00.000 +000.000 +7070.0 20140923 20150926
008260 99999 WXPOD8270 +00.000 +000.000 +0000.0 20050101 20100920
Trying to extract a given column, which can be 'Elev' or 'USAF' or 'STATION NAME' etc. It is known apriori which column needs to be extracted, for example, column #1 (USAF). Running into problems because the 'STATION NAME' sometimes has a blank in between its alphanumeric code and sometimes it is just one code without any blanks. Also, other fields can be blank sometimes, for example CTRY. In the above 4 lines of the shortened input file, 'ST' and 'CALL' are empty, but they can be filled (and are usually alphabet codes).
Also,
(1). how to extract the USAF entries corresponding to only CTRY==AF ?
(2). how to extract all the rows with rowNumber=10000 to rowNumber=20000 (say).
Thanks.
Risposta accettata
Più risposte (1)
Categorie
Scopri di più su Large Files and Big Data in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!