Clear Filters
Clear Filters

how to convert a text file into mat file having unequal delimiters in each line?

1 view (last 30 days)
Hi, I am trying to convert a text file (space separated) to mat file. As soon as I apply delimiter command, I receive an error that delimiters are of unequal numbers. For example, first line contains 3 spaces while second line contains 4 spaces. Is there any way to convert text file with unequal delimiters into mat file? I am using following code. Any help would be appreciated and receiving this error. Thanks Code is attached
readtable('filename','Delimiter',' ','ReadVariableNames',false);
Error using readtable (line 143)
Reading failed at line 4. all lines of a text must have same number of delimiters. Line 4 has 2 delimiters while preceding lines have 3.

Answers (1)

Yasir Ali
Yasir Ali on 3 Nov 2017
cvklpstunc Here is the text file. Thanks

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!