Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Yasir Ali
Yasir Ali le 3 Nov 2017
Commenté : Yasir Ali le 3 Nov 2017
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.

Réponses (1)

Yasir Ali
Yasir Ali le 3 Nov 2017
cvklpstunc Here is the text file. Thanks
  2 commentaires
Yasir Ali
Yasir Ali le 3 Nov 2017
Please see attached. Also I have attached to my original question.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by