フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

textfile

1 回表示 (過去 30 日間)
Muhammad shahbaz
Muhammad shahbaz 2011 年 7 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
i have written a code in matlab gui which generates a text file and prints some text in it.i want to print a value in the very first line of this text file and each time the code run the value is to be replaced in the very first line while the remaining reading of text file start from second line,any command to adjust the line to be read or print will be helpful

回答 (2 件)

Image Analyst
Image Analyst 2011 年 7 月 16 日
See the examples in the documentation for fseek().

Walter Roberson
Walter Roberson 2011 年 7 月 16 日
Replacing a line of text in a file is only possible if the replacement text is exactly the same size as the original. If the new text would be smaller than the original, you would have to pad the new text out to be exactly the same size as the old text. If the new text would be larger than the old text, then you end up having to rewrite the entire file.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by