How to extract specific rows & columns from a text file

8 ビュー (過去 30 日間)
Saiful Amri
Saiful Amri 2021 年 5 月 24 日
コメント済み: KSSV 2021 年 5 月 25 日
Hi, I would like to read specific column from txt file (values - 4.682,6.050,6.461 and so on) and it have 25 lines. So how can I do it?
Thanks.
Here is the txt file looks like:
2008 1 1 0.00 100.00 0.41873E+11 -1.0 263.9 0.27177E+12 3.208 4.682 -1.000 4.0
2008 1 1 1.00 100.00 0.65528E+11 -1.0 278.2 0.45383E+12 2.997 6.050 -1.000 4.0
2008 1 1 2.00 100.00 0.83093E+11 -1.0 300.3 0.51760E+12 2.763 6.461 -1.000 4.0

採用された回答

KSSV
KSSV 2021 年 5 月 24 日
Read about the functions like importdata, load, readmatrix, textscan, readtable.
data = importdata(mytextfile) ;
iwant = data(:,11) ; % give required column of index
  2 件のコメント
Saiful Amri
Saiful Amri 2021 年 5 月 25 日
Thank youuuu!
KSSV
KSSV 2021 年 5 月 25 日
Thanks is accepting the answer.. 🙂

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

その他の回答 (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