How to delete data from text file?

조회 수: 5 (최근 30일)
Arun Badigannavar
Arun Badigannavar 2016년 5월 11일
답변: Walter Roberson 2016년 5월 11일
[71.7 611.7 251.7 431.7] is tab delimited data on 14th line, second data, I want to delete 431.7, How to do it?
  댓글 수: 1
Arun Badigannavar
Arun Badigannavar 2016년 5월 11일
Data1 [71.7 611.7 251.7 431.7] Description, all these three data are tab delimited, in the second tab I have data, which I want to alter

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 5월 11일
You need to read in the data, make the change, and write it out again, preferably to a different file (so that if there is a problem you do not lose the original.)
The only circumstance under which you can alter a text file "in place" is if the replacement is exactly the same size as the original.

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by