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
ubaid haroon
ubaid haroon 2017년 10월 20일
Very neat. I was able to use this piece of code

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

추가 답변 (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