Read in CSV files using GUI
조회 수: 5 (최근 30일)
이전 댓글 표시
If I want MATLAB to read in the following file using the GUIDE feature in MATLAB:
Source File:
ID:
C
C
C
C
R
F
L
T
E
Date Time Ch:
03/24/2012 28:43.0 -142.315
03/24/2012 28:43.0 -142.316
03/24/2012 28:43.0 -142.318
and so on,
how can I read the file if the extension is not .csv, say, .pl4?
With a .csv I could use the following but that only assumes if the file .csv which in my case it's not.
fid=fopen('filename.csv');
header = textscan(filenamecsv, '%s',3, 'delimeter' ',','headerLines',16);
data=textscan(filenamecsv, '%s %s %s', 'delimiter', ' ,');
data_to_plot=str2double(data{3});
fclose(filenamecsv);
댓글 수: 0
채택된 답변
Walter Roberson
2013년 1월 13일
fid = fopen('filename.pl4');
header = textscan(fid, '%s', 3, 'headerLines', 16);
data = textscan(fid, '%s %s %f');
data_to_plot = data{3};
fclose(fid);
댓글 수: 0
추가 답변 (1개)
T
2013년 1월 13일
댓글 수: 14
Walter Roberson
2013년 1월 17일
If you know how long it will take, use a timer object to update it, and hope that the innards of textscan() are not built-in functions (timers cannot interrupt built-in functions.)
참고 항목
카테고리
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!