Matlab:使用textscan以不同的行格式加载csv的第n列

Matlab:使用textscan以不同的行格式加载csv的第n列,matlab,Matlab,我正在尝试加载带有分号(;)分隔符的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 = ['%

我正在尝试加载带有分号(;)分隔符的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行重复此操作


非常感谢您的帮助

请查看此问题的答案。我不认为你真的可以跳过这个专栏,但一旦你得到了输出,你可以说:

x = read_mixed_csv('example.csv',';');
y = x{:, [1,2, 11:size(x, 2)]};