textscan 4th row into one string

1 回表示 (過去 30 日間)
Terek Li
Terek Li 2017 年 2 月 16 日
編集済み: per isakson 2017 年 11 月 11 日
Hi,
I have a huge file that I want to read only the 4th row with delimiter ';'. I want to read everything in this row into one single string so that I can count the number of ';' and determine how many columns there are. What is the code to do this?
I have tried
result = textread('U:\EMC\SMI8A_75_FA.csv', '%s', 1, 'headerlines', 3);
but the results are off.
Thanks!

採用された回答

per isakson
per isakson 2017 年 11 月 11 日
編集済み: per isakson 2017 年 11 月 11 日
One way using textscan
fid = fopen( 'U:\EMC\SMI8A_75_FA.csv', 'r' );
result = textscan( fid, '%s', 1, 'headerlines',3, 'Delimiter','\n');
fclose( fid );

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by