フィルターのクリア

Reading some part of a file

3 ビュー (過去 30 日間)
Yongmin
Yongmin 2015 年 5 月 10 日
コメント済み: Yongmin 2015 年 5 月 10 日
Hello. I have a text file to read and I use the following commands to read the data.
fid = fopen('filename.dat','r');
formatspec = '%8c %6c %6c %d %64c %10c %d %d %s %s %s';
data = textscan(fid,formatspec,'Delimiter',',');
To save memory for the cell "data", I'd like to read only last 3 text strings. Would you please how to read a part of the file?
Many thanks for sharing your time.

採用された回答

per isakson
per isakson 2015 年 5 月 10 日
Replace
formatspec = '%8c %6c %6c %d %64c %10c %d %d %s %s %s';
by
formatspec = '%*8c %*6c %*6c %*d %*64c %*10c %*d %*d %s %s %s';
  1 件のコメント
Yongmin
Yongmin 2015 年 5 月 10 日
Hi per isakson, Thanks a lot for your kind and prompt answer. It really is what I wanted to do.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by