How to remove first three columns from a text file?

6 ビュー (過去 30 日間)
DC
DC 2016 年 2 月 12 日
コメント済み: Jan 2018 年 12 月 18 日
Want to have a text file with only the last four column values. Thanks
  2 件のコメント
Cg Gc
Cg Gc 2018 年 12 月 18 日
I am having a similar problem.
I would like to keep the first 13 columns in the text file and get rid of the remaining. The header can stay or not as it is ignored in my analysis.
I tried the code below, but it either didn't work because of the header.
blah = importdata('tdump00120100.txt');
datayouwant = blah.data;
Struct contents reference from a non-struct array object.<--error message
Or I ended up with a long column of data instead of rows.
Any help would be appreciated. I have lots of these files to do.
Thanks bunches.
Jan
Jan 2018 年 12 月 18 日
@Cg Gc: Please do not hijack an existing thread by injecting a new question in the section for comments. Prefer to open a new questions.

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

回答 (1 件)

Jon
Jon 2016 年 2 月 13 日
blah = importdata('1_rowdel.txt');
datayouwant = blah.data;
save('mydata.txt','datayouwant','-ascii')

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by