i want to clear data from textfile by pushboton

1 回表示 (過去 30 日間)
mahmoud elymany
mahmoud elymany 2016 年 6 月 11 日
回答済み: Walter Roberson 2016 年 6 月 11 日
clear data of text file

採用された回答

Walter Roberson
Walter Roberson 2016 年 6 月 11 日
Because it is a text file, you will need to read the text file, and create a new text file that has only the contents you want to keep: the parts you want to remove should just not be written to the new text file.
None of MS Windows, OS-X or Linux (the operating systems that MATLAB is supported on) have any mechanism to delete something out of the middle of a file. The operating systems themselves do all provide ways to truncate a file at a given point, removing everything from there to the end of the file, but MATLAB does not provide access to that operating system facility. The only way in MATLAB is to copy what is still wanted and not copy what is no longer wanted.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by