How can i write formatspecififcation regarding to amount of my line?

1 次查看(过去 30 天)
Now i am reading like txt files .first Comes Parameters than values. Every measurement file have different number of values that's why formatSpecification changes. Exmaple:
formatSpec4 = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%........%[^\n\r]';
(s* amount of-line) how can i define my format specification regarding to line number?
  7 个评论
cemsi888
cemsi888 2015-3-5
i can create desired amount of s and combined[^\n\r] but when i want read datas it gives me error.
Wertepar = textscan(fid1, formatSpec, lines-Gesamtzeile{1,1}, 'Delimiter', delimiter1, 'HeaderLines', Gesamtzeile{1,1}, 'ReturnOnError', false)´
program assume that formatspec ist just= %s
i used debug and wrote
a=fprintf('[^\\n\\r]',formatspec)
it gives me as a result 7.than i used num2str to convert number to string however it does not work too...

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by