MATLAB: How to read first lines of a txt file and omit first text lines and take the numbers data from text data as a separate columns

MATLAB

Trigger mode: 1
Integration Time (sec): 1,000000E-2
Scans to average: 1
Electric dark correction enabled: true
Boxcar width: 0
XAxis mode: Wavelengths
>>>>>Begin Data<<<<<
194,838 4,62
195,105 4,62
195,372 4,62
195,639 -14,38
195,906 -12,38
196,173 -0,38

Best Answer

Read about textscan with headerlines option.
fid = fopen('data.txt','r') ;
S = textscan(fid,'%f, %f %f,%f','HeaderLines',7,'delimiter','\n') ;
fclose(fid) ;
S{1}
S{2}
S{3}
S{4}