textscan in all columns for the first row
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi,
I am having dificulties to read (load) a single row of a random size file. Please, how can I do it?
For ie. I would like to read all colums for the fisrt row of a csv file and create a string vector.
Thank you very much
Best Regards
Rafael
댓글 수: 2
Adam Danz
2018년 11월 23일
What difficulties are you having? What have you tried and why isn't it working?
채택된 답변
Cris LaPierre
2018년 11월 23일
댓글 수: 3
Cris LaPierre
2018년 11월 24일
편집: Cris LaPierre
2018년 11월 24일
You would use a while loop to continue reading in the data a line at a time until you got to the end of file (feof).
while ~feof(fid)
tline = fgetl(fid);
disp(tline)
end
You would want to process each line and assign your data to a variable using indexing so as not to overwrite the previously saved values.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!