How to remove first three columns from a text file?

조회 수: 4 (최근 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 CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by