Importing METAR data from sequence of .txt-files
3 次查看(过去 30 天)
显示 更早的评论
Hi! I have some problems importing data from files that look like this:
METAR ESDF 010020Z AUTO 31003KT 230V350 9999NDV NCD 12/08 Q1017 METAR ESDF 010050Z AUTO 24003KT 230V320 9999NDV NCD 12/08 Q1017 METAR ESDF 010120Z AUTO 25003KT 230V350 9999NDV NCD 11/08 Q1017 METAR ESDF 010150Z AUTO 25005KT 230V350 9999NDV NCD 11/08 Q1017 METAR ESDF 010220Z AUTO 24005KT 230V310 9999NDV NCD 11/08 Q1017 METAR ESDF 010250Z AUTO 30003KT 230V350 9999NDV NCD 11/08 Q1017 METAR ESDF 010320Z AUTO VRB02KT 9999NDV NCD 11/08 Q1017 METAR ESDF 010350Z VRB02KT CAVOK 11/08 Q1017 METAR ESDF 010420Z 00000KT CAVOK 12/09 Q1018 METAR ESDF 010450Z 29003KT CAVOK 12/11 Q1018 METAR ESDF 010520Z 30005KT 230V350 CAVOK 13/11 Q1018
The import stops around line 6300 out of 450000. The reason is a linechange in the .txt file that is erroneous. Is there a way of blocking this line and continue with the next instead?
The next step for me is to import a sequence of these files with:
txtFiles = dir('*.txt') numfiles = length(txtFiles); mydata = cell(1, numfiles);
for k = 1:numfiles try mydata{k} = importdata(txtFiles(k).name); catch disp('error') end end
Are there any better way of importing these files?
Thank you!
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!