Read .csv file to 2D array as in the file - Not one column
1 次查看(过去 30 天)
显示 更早的评论
Please help me in the following:
I have a .csv file contains several rows and just one column .. Each cell contain long string which is separated by tab (string and integers)
For example as follows
"userid tz call_time status direction description number_prefix number in_phonebook duration"
"18672001271175066DeliveredIncomingShortmessage10495811f0c88324863d7e1a0205874c36ba4aedee737ed06708f1c2104192ad 0 0"
"18672001271175095DeliveredIncomingShort message10495811f0c88324863d7e1a0205874c36ba4aedee737ed06708f1c2104192ad 00"
Each phrase is contained in 1 cell
I want to convert it to 2d matrices in matlab in order to convert it to . mat file as follows:
Userid tz call_time status ... 186 7200 1271175
I used textread('file.csv', '%s') ans the result was as follows:
Userid tz call_time status ... 186 7200 1271175
1D ans all in just one column..
Could any one help
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!