Clear Filters
Clear Filters

Load data from txt file

2 views (last 30 days)
Pietro Rossi
Pietro Rossi on 20 Oct 2011
Hi to everyone! My saved output is in a txt file like this:
LECROYWS454,18357,Waveform
Segments,1,SegmentSize,249980
Segment,TrigTime,TimeSinceSegment1
#1,18-Oct-2011 15:28:23,0
Time,Ampl
-0.499955983,0.000559277
-0.499951983,0.000560498
-0.499947983,0.000562451
-0.499943983,0.000563672
...
I want load this data in a matrix with two column (time - amplitude), skipping first 5 lines. How can I do this?

Accepted Answer

Walter Roberson
Walter Roberson on 20 Oct 2011
fid = fopen('LECROYWS454.txt','rt');
result = textscan(fid, '%f%f', 'HeaderLines',5, 'Delimiter',',', 'CollectOutput', 1);
fclose(fid);
YourData = result{1};
clear result

More Answers (0)

Categories

Find more on Large Files and Big Data in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!