Import .csv with missing delimiters and values
Mostra commenti meno recenti
I am trying to import some (generated) .csv files into MATLAB. Unfortunately, some of the files have rows with blank entries AND missing delimiters (in my case a semi-colon is the delimiter). This means when I am trying to import the .csv file using readtable, the dimensions of the table are wrong, i.e. MATLAB is confused and packs the data in cells. I need the table to be the right size so that I can use it later on.
An example .csv file would look like this:
date;time;var1;var2;var3
02.06.21;15:00:00;1;2;3
02.06.21;16:00:00;4
02.06.21;17:00:00;5;6;7
As you can see, there are missing values in the second row AND the delimiters are also missing. Is there any way I can import the .csv file so that the table has the width of the widest row, and that the needed delimiters would be added automatically (I don't really care about the value that would be put in these spaces but I need the format).
Thanks for any help in advance!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spreadsheets in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!