"Alex Ezell" <[EMAIL PROTECTED]> wrote
> Thanks to everyone for the help. My coworker seems to really prefer
> doing it via some system call.
>
> She seems to think it's possible quickly with csplit, which I've
> never
> used. I'll be investigating it in the morning, because she's really
> good
Thanks to everyone for the help. My coworker seems to really prefer
doing it via some system call.
She seems to think it's possible quickly with csplit, which I've never
used. I'll be investigating it in the morning, because she's really
good at what she does. :)
/alex
On Wed, Feb 27, 2008 at 6:
This is bill's method written out in code which is the python you seek,
young warrior!
inname = 'inputfile'
outname = 'outfile'
infile = open(inname,'r')
outfile = open(outname,'w')
infile.readline()
line = infile.readline()
while line != "":
outfile.write(line)
infile.close()
outfile.close()
"Alex Ezell" <[EMAIL PROTECTED]> wrote
>> > What I need to do is to truncate the first line of a file which
>> has an
>> > unknown number of lines and an unknown size.
> I might do something like this:
> os.system("sed -i '1d' %s" % filename)
>
> I suspect it will be much faster on large file
On Wed, Feb 27, 2008 at 5:01 PM, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Alex Ezell wrote:
> > I must be missing some simple method on a file object or something.
> >
> > What I need to do is to truncate the first line of a file which has an
> > unknown number of lines and an unknown size.
On Wed, Feb 27, 2008, Alex Ezell wrote:
>I must be missing some simple method on a file object or something.
>
>What I need to do is to truncate the first line of a file which has an
>unknown number of lines and an unknown size.
>
>The only thing I can think to do is to readlines() and then slice o
Alex Ezell wrote:
> I must be missing some simple method on a file object or something.
>
> What I need to do is to truncate the first line of a file which has an
> unknown number of lines and an unknown size.
>
> The only thing I can think to do is to readlines() and then slice off
> the first l
I must be missing some simple method on a file object or something.
What I need to do is to truncate the first line of a file which has an
unknown number of lines and an unknown size.
The only thing I can think to do is to readlines() and then slice off
the first line in the resulting list, then