matlab - Read line delimited by comma and tab -
i read files containing numbers in each line. here example of format-
0,0,0 1 0 0 0 0.02,0.1,0.98 8.77 0.985292 0.112348 0.112348 0.04,0.2,1.96 8.77 0.985292 0.112348 0.224696
as above shown, first 3 numbers separated commas, after rest numbers separated tab in line. result, not possible use dlmread or textscan. there way solve it? thanks!
yes should add 2 parameters in function:
delimiter %choose delimiter
and
multipledelimsasone %treat repeated delimiters one
option 1:
small "trick" can select more 1 delimiter if give structure input: {',',' '}
.
result = textscan(fileid,'%f %f %f %f %f %f %f','delimiter',{',',' '},'multipledelimsasone',1);
option 2: (that should work)
this time don't use multipledelimsasone
precise delimiter can comma or tab (with \t).
result = textscan(fileid,'%f %f %f %f %f %f %f','delimiter',{',','\t'});
Comments
Post a Comment