Load csv file with multi lines of headers in matlab 2012a

How to load a file like this in matlab2012a: ----------------------- Test Results as of 5/31/2013 Tester, ABC and DEF Tester,Result1, Result2 ABC, 1.2, 2.3 DEF, 0.5, 6.5 ABC, 4.5, 4.6 DEF, 3.3, 5.6 End of 5/31/2013 -----------------------
I need to store the date "5/31/2012" into a veriable and line 4 to line 8 to another.

1 Comment

Cal, can you fix the carriage returns in your example? It is showing as just one long line, so I can't figure out where the line breaks should be.

Answers (1)

I think the best way is to get the data. As is probably will be split by spaces, but you can also look for the first '\', then you know how many numbers after/before should be there.
data = importdata("C:\text.txt");

1 Comment

Is importdata available for 2012a? I just got upgraded from 2011a to 2012a and don't think I can get 2013a for a while.

This question is closed.

Tags

Asked:

Cai
on 31 May 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!