Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Reading txt files with Matlab

Status
Not open for further replies.

bababui

Junior Member level 3
Joined
Apr 12, 2009
Messages
26
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,283
Location
USA
Activity points
1,474
I have a bunch of identically formated text file that I need to load into matlab. First 30 lines of the files contain junk info that I don't need. How Can I specify that I would like to read a text file starting from a specific line?
So first 30 lines of the text file have data in two columns after this, comes that data that I need, which is in 5 columns.

Thanks
 

Use while loop to read your file line by line until you reach EOF, and inside that loop use counter that keeps incremented every cycle, and every time check that counter reached the line number you wanna start from or exceeded through if condition statement (could be set as a variable too),

So first 30 lines of the text file have data in two columns after this, comes that data that I need, which is in 5 columns.
What do you mean by this?

Regards,
Ahmad
 

For example here's a text file


ABCD 123
DEFG 234
KHF sdf

a b c d e f
1 2 3 4 5 6
2 2 3 4 5 6
3 2 3 4 5 6
4 2 3 4 5 6
5 2 3 4 5 6
6 2 3 4 5 6

So my text file is something like above. The first thre rows is some information that I do not care about. What I really want is to import the information below ( just the numbers)
1 2 3 4 5 6
2 2 3 4 5 6
3 2 3 4 5 6
4 2 3 4 5 6
5 2 3 4 5 6
6 2 3 4 5 6
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top