How to skip lines while loading text (.txt) files ?

3 ビュー (過去 30 日間)
Md Fakhra Alam Faisal
Md Fakhra Alam Faisal 2018 年 1 月 27 日
回答済み: Md Fakhra Alam Faisal 2018 年 1 月 27 日
zghsryfkmgcbg
fnmfmn fhmfmfjmfm njdmf
ddgjd
fgjnfm nm ncncgn
fhjmvbnmvnmhgmfh
fnmhm
fdhmdtmgkmuykmnf
fjrykj fjryjtukmfryfk
ghugfhjgkjhklhfjfgjfjfh
_1_ 3454
_2_ 4667
_3_ 5645
_4_ 4564
_5_ 76457
_6_ 4574
_7_ 46574
_8_ 6574
_9_ 746
_10_ 4
_11_ 47568
_12_ 578
_13_ 87
_14_ 56
_15_ 36
_16_ 473
_17_ 636
_18_ 3
_19_ 56
  3 件のコメント
Md Fakhra Alam Faisal
Md Fakhra Alam Faisal 2018 年 1 月 27 日
1 3454
2 4667
3 5645
4 4564
5 76457
6 4574
7 46574
8 6574
9 746
10 4
11 47568
12 578
13 87
14 56
15 36
16 473 17 636
18 3
19 56
Here i want like two columns
Stephen23
Stephen23 2018 年 1 月 27 日
Is the number of header lines always the same?"
Does the numeric data really have underscores around it?
(note: it would be much simpler if you just uploaded a sample file).

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

採用された回答

Md Fakhra Alam Faisal
Md Fakhra Alam Faisal 2018 年 1 月 27 日
Thanks a lot, @Stephen Cobeldick I've found the solution. The problem was simply skipping some header line and read the rest body by two column. here the script now I am using
AAA = fopen('XXX.txt', 'rt'); % File Name XXX.txt
BBB = textscan(AAA, '%f %f', 'HeaderLines',9); % To skip 9 Header line
Column_1=BBB {1,1};
Column_2=BBB {1,2};

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by