On Thu, 19 Feb 2009 13:56:38 -0800, oamram wrote:
> new to python. i have a directory with about 50 text file and i need to
> iterate through them and get
> line 7 to 11 from each file and write those lines into another file(one
> file that will contain all lines).
Untested:
from __future__ impo
;> new to python. i have a directory with about 50 text file and i need to
> >>>> iterate through them and get
> >>>> line 7 to 11 from each file and write those lines into another file(one
> >>>> file
> >>>> that will contain all lines
ile and i need to
>>>> iterate through them and get
>>>> line 7 to 11 from each file and write those lines into another file(one
>>>> file
>>>> that will contain all lines).
>>>> Cheers, Omer.
>>>> --
>>>> View this
h them and get
>> > line 7 to 11 from each file and write those lines into another file(one
>> > file
>> > that will contain all lines).
>>
>> > Cheers, Omer.
>> > --
>> > View this message in
>> > context:http://www.nabble.com/i
another file(one file
> > that will contain all lines).
>
> > Cheers, Omer.
> > --
> > View this message in
> > context:http://www.nabble.com/iterating-through-files-tp22048070p22048070.html
> > Sent from the Python - python-list mailing list archive at Nabb
rs, Omer.
> --
> View this message in
> context:http://www.nabble.com/iterating-through-files-tp22048070p22048070.html
> Sent from the Python - python-list mailing list archive at Nabble.com.
I would recommend using the glob module to grab a list of the files
you want or you can just
/iterating-through-files-tp22048070p22048070.html
Sent from the Python - python-list mailing list archive at Nabble.com.
--
http://mail.python.org/mailman/listinfo/python-list