I have a .asc file 'test.asc' which consists of lines with different length and content.
my name is blalala
This is my home and I live in here
12 13 10 is he
he is my brother 12 13 14
How can I import the contents of the file into a MATLAB cell array where each row is a line separated by space delimiter?
resultCellarray={
'my' 'name' 'is' 'blalala' [] [] [] [] []
'This' 'is' 'my' 'home' 'and' 'I' 'live' 'in' 'here'
'12' '13' '10' 'is' 'he' [] [] [] []
'he' 'is' 'my' 'brother' '12' '13' '14' [] []
}
I have tried inserting each line as one cell:
content = textread('test.asc','%s','delimiter','\n','whitespace','');
and then dividing the cell into several columns, using: separating cell array into several columns MATLAB, but it is taking a lot of time when the file is large. What is the fastest way to do this?