Please I want to know how to delete the first line of a file text with matlab ?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Imen Mani
il 12 Mag 2016
Commentato: ubaid haroon
il 20 Ott 2017
Please help me ! thank you
0 Commenti
Risposta accettata
Walter Roberson
il 12 Mag 2016
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Low-Level File I/O in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!