delete first line in a file

Fredrik Lundh fredrik at pythonware.com
Fri Jun 30 06:32:28 EDT 2006


Juergen Huber wrote:

> i am a dummy user in python and new in this programming language and so
> there will be questions, that´s for you no problem! i never have before
> programmed in any language! sorry for this! i hope you will help me, that i
> also could the basics in this language! and later many more, so i hope ! :)
>
> the first question for me in this newsgroup will be the follow one:
>
> - is there a way to delete in a csv-file the first line?!

in general, modern file systems can only remove and add stuff at the end of a
file, so the only way to do this is to rewrite the entire file.

(you can either load the entire file, fix it up, and write it out again, or copy the
file to a new file, skipping the first line or row).

</F> 






More information about the Python-list mailing list