How to import file.dat to matlab without delimiter

2 次查看(过去 30 天)
Hi I have file.dat that contain data like this
7756|01/01/2016 00:15:00|182.422478353023|33554432
7756|01/01/2016 00:30:00|170.79956543853|33554432
How to extract these data in 4 column by delimiting '|' ?

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2017-12-14
out=importdata('file.dat','|')
  2 个评论
Pradya Panyainkaew
Pradya Panyainkaew 2017-12-14
thank you Fangjun Jiang
However, an output matrix shows an empty matrix. there isn't any element in that output matrix. How can I fix it ?
Fangjun Jiang
Fangjun Jiang 2017-12-14
>> importdata('file.dat','|')
ans =
struct with fields:
data: [2×2 double]
textdata: {2×2 cell}
colheaders: {'7756' '01/01/2016 00:30:00'}

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by