Import .csv with missing delimiters and values
显示 更早的评论
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!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!