【发布时间】:2015-08-03 19:07:42
【问题描述】:
我正在尝试加载带有分号 (;) 分隔符的 csv 文件。
例子:
150501;190722;ms_since_start=;30001276;temp=;31.97;IT=;147753;spec num=;1000;(here i have 512 floating number repetitions and ';;' to indicate the end of line)
此模式重复 1000 行。
我一直在尝试使用 textscan,但只能使用以下代码获取空单元格
formatSpec = ['%s%s%*s%*s%*s%*s%*s%*s%*s%*s%*s' repmat('%f', [1,512]) '%*[^;;]']
M = textscan(dirtmp, formatSpec, 'Delimiter', ';')
目标是获取前 2 列,跳过 9 列,获取剩余的 512 列,然后对 1000 行重复此操作。
非常感谢任何帮助
【问题讨论】:
标签: matlab