Importing METAR data from sequence of .txt-files
조회 수: 2 (최근 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!