Re: delete first line in a file



Juergen Huber schrieb:
Fredrik Lundh wrote:
Juergen Huber wrote:

ok...i thought as much, that i have to copy this file!

how will i do that?!
how will i fix this file => delete the first line?!

with which commands could i do that?!
start here:

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

.



Relevant Pages

  • Re: [PATCH] hpsa: SCSI driver for HP Smart Array controllers
    ... Should be no problem to fix that. ... True if this host adapter can make good use of clustering. ... We run out of commands here. ... Using bitmap to manage free commands looks too complicated a bit to ...
    (Linux-Kernel)
  • Vista Black screen, only mouse at startup. Need to un/reinstall graphics driver
    ... So basically I was installing new grahpics drivers from the nvidia ... different kinds of boot options and keyboard commands. ... *I cannot access device manager from Command Prompt ... from recovery disk to fix my grahpics driver. ...
    (microsoft.public.windows.vista.performance_maintenance)
  • Re: [opensuse] Need help!
    ... reiserfsck is tell me I can use a -B flag to fix it but when I try to ... For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx ... get one bad block that the disk drive internals cannot hide from ...
    (SuSE)
  • Re: F8 is a problem
    ... the subject is changed and acknowledgement is missing. ... commands was missing always. ... out a fix at all. ... fedora-list mailing list ...
    (Fedora)
  • Re: [PATCH 2.6.15-rc6] block: Make CDROMEJECT more robust
    ... The main reason for getting the CDROMEJECT ioctl working was ... >> because it didn't need root privileges like the SG_IO commands did. ... Can you point me to this fix? ... > Do this in the eject tool, if it's required for some devices. ...
    (Linux-Kernel)