Reading certain parts of text file
Ältere Kommentare anzeigen
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
Antworten (1)
Azzi Abdelmalek
am 13 Jan. 2014
Bearbeitet: Azzi Abdelmalek
am 13 Jan. 2014
a=importdata('file.txt')
data=a.data
5 Kommentare
ALEX
am 13 Jan. 2014
Azzi Abdelmalek
am 13 Jan. 2014
what do you mean? and post a sample of your file
ALEX
am 13 Jan. 2014
Bearbeitet: Azzi Abdelmalek
am 13 Jan. 2014
Azzi Abdelmalek
am 13 Jan. 2014
Bearbeitet: Azzi Abdelmalek
am 13 Jan. 2014
fid=fopen('file.txt')
out=textscan(fid,'%f %f','HeaderLines',12,'Delimiter',',')
fclose(fid)
M=cell2mat(out)
ALEX
am 13 Jan. 2014
Bearbeitet: Azzi Abdelmalek
am 13 Jan. 2014
Kategorien
Mehr zu Audio and Video Data finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!