Please I want to know how to delete the first line of a file text with matlab ?

2 次查看(过去 30 天)
Please help me ! thank you

采纳的回答

Walter Roberson
Walter Roberson 2016-5-12
One way is to fopen the file for reading, fopen a different file for writing, fgetl the first line of the input and throw it away. Now fread the rest of the input and fwrite to the output. fclose both. Rename the output file to the input name.
There are other ways, but there is no direct way to delete a line: they all come down to copying input to output leaving out the part you do not want.
  6 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Low-Level File I/O 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by