Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

read txt file instead of dlmread

Asked by huda nawaf on 1 May 2012

hi, are there other way instead of dlmread read txt file has non equal rows?

I deal with very big size txt file . for example , i want read txt file with 17000 rows and different no. of columns . when used dlmread , i have to wait very long time to get data

thanks in advance

0 Comments

huda nawaf

Tags

Products

No products are associated with this question.

2 Answers

Answer by Daniel on 1 May 2012
Accepted answer
doc textscan

2 Comments

huda nawaf on 1 May 2012

i can not use textscan, may the no. of columns more than 100
thanks

Daniel on 1 May 2012

http://www.mathworks.co.uk/help/techdoc/import_export/f5-35378.html

Suggests using textscan for both large and non rectangular text files. I do not believe that 17,000 rows or 100 columns should be any problem at all for textscan.

If you follow the documentation for using lower level file i/o also.

Daniel
Answer by tlawren on 1 May 2012

On average, how many columns are there? Or, better yet, what is the maximum number of columns you might expect in your data? I can quickly load text files with 100k rows and in upwards of 100 columns on my machine. But then again, that may be small compared to what you are dealing with. If you are working on the same files over and over, it might be worthwhile to spend some time formatting and re-saving your data in form that is easier to handle.

1 Comment

huda nawaf on 1 May 2012

i can not guesses, i get if from other process

tlawren

Contact us