Reading certain parts of text file
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi,
I'm trying to access certain parts of a text to process data. The text file has a header and many rows of numbers, starting at lines 13 through 4016 is a two column array. This is comma delimited. It would be nice to track information of this file located in the header but firstly I just want to bring all of these numbers into Matlab for processing. The formats don't change per text file just the numbers.
Thanks for your help, Alex
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2014년 1월 13일
편집: Azzi Abdelmalek
2014년 1월 13일
a=importdata('file.txt')
data=a.data
댓글 수: 5
Azzi Abdelmalek
2014년 1월 13일
편집: Azzi Abdelmalek
2014년 1월 13일
fid=fopen('file.txt')
out=textscan(fid,'%f %f','HeaderLines',12,'Delimiter',',')
fclose(fid)
M=cell2mat(out)
참고 항목
카테고리
Help Center 및 File Exchange에서 Standard File Formats에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!