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

delete the first line

Please help me ! thank you

Best Answer

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.