Re: delete first line in a file
- From: Schüle Daniel <uval@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 13:30:45 +0200
Juergen Huber schrieb:
Fredrik Lundh wrote:Juergen Huber wrote:
ok...i thought as much, that i have to copy this file!start here:
how will i do that?!
how will i fix this file => delete the first line?!
with which commands could i do that?!
http://docs.python.org/tut/node9.html#SECTION009200000000000000000
</F>
that documentation i have already read, but it wouldn`t help me for my
problem!
i know, how i can read the first line an print them on the screen!
but...how can i say python, delete the first line?!
thats my problem!
in the entry of my posting i wrote, that i am a newbie and so please
understand me, that i ask so questions?! :-)
thanks for your help!
simple!
f = file("old.file")
ignore = f.readline()
file("new.file", "w+").write(f.read())
hth, Daniel
.
- References:
- delete first line in a file
- From: Juergen Huber
- Re: delete first line in a file
- From: Fredrik Lundh
- Re: delete first line in a file
- From: Juergen Huber
- Re: delete first line in a file
- From: Fredrik Lundh
- Re: delete first line in a file
- From: Juergen Huber
- delete first line in a file
- Prev by Date: Re: delete first line in a file
- Next by Date: Re: Interprocess communication on multi-user machine
- Previous by thread: Re: delete first line in a file
- Next by thread: Re: delete first line in a file
- Index(es):
Relevant Pages
|