필터 지우기
필터 지우기

remove header in file

조회 수: 7 (최근 30일)
joo tan
joo tan 2011년 12월 5일
댓글: chocho 2017년 2월 18일
latitude, longitude, wind_speed, zonal_wind_speed, meridional_wind_speed, quality_flag
15.25, 94.75, 314, -267, -81, 0
15.25, 95.25, 427, -333, -186, 0
15.25, 95.75, 452, -290, -290, 0
15.25, 96.25, 459, -211, -389, 0
15.25, 96.75, 471, -91, -453, 0
15.25, 97.25, 519, 1, -511, 0
15.25, 97.75, 32767, 32767, 32767, 2
15.25, 98.25, 32767, 32767, 32767, 2
15.25, 98.75, 32767, 32767, 32767, 2
15.25, 99.25, 32767, 32767, 32767, 2
15.25, 99.75, 32767, 32767, 32767, 2
15.25, 100.25, 32767, 32767, 32767, 2
15.25, 100.75, 32767, 32767, 32767, 2
15.25, 101.25, 32767, 32767, 32767, 2
15.25, 101.75, 32767, 32767, 32767, 2
15.25, 102.25, 32767, 32767, 32767, 2
  댓글 수: 2
Sven
Sven 2011년 12월 5일
What's your question? Do you want to read your data into matlab (without the header) or do you want to delete the first line from the file and re-save it?
joo tan
joo tan 2011년 12월 13일
I want to load the data into matlab without header

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2011년 12월 13일
fmt = repmat('%f',1,6);
fid = fopen('YourFileName.txt', 'rt');
datacell = textscan(fid, fmt, 'Delimiter', ',', 'HeaderLines', 1, 'CollectOutput', 1);
fclose(fid);
TheData = datacell{1};
clear datacell
  댓글 수: 15
Walter Roberson
Walter Roberson 2017년 2월 18일
You cannot write to any directory under "C:\Program Files (x86)" because MS Windows will not allow that. You need to cd to a different directory and work there.
chocho
chocho 2017년 2월 18일
oh that's why ,you know i put all the files in this directory C:\Program Files (x86)\MATLAB\R2012a thanks a lot ....

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by