[Tutor] Parsing data from a set of files iteratively

Joel Goldstick joel.goldstick at gmail.com
Fri May 18 20:31:26 CEST 2012


On Fri, May 18, 2012 at 2:23 PM, Spyros Charonis <s.charonis at gmail.com> wrote:
> Dear Python community,
>
> I have a set of ~500 files which I would like to run a script on. My script
> extracts certain information and
> generates several lists with items I need. For one of these lists, I need to
> combine the information from all
> 500 files into one super-list. Is there a way in which I can iteratively
> execute my script over all 500 files
> and get them to write the list I need into a new file? Many thanks in
> advance for your time.
>
> Spyros
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>

Yes, of course.  Python comes with the os module.  You should google
'iterating over files in a folder in python to learn a bit about it.
Also, its best if you ask specific questions.  Paste your present code
into your email and tell us what works or what doesn't.

-- 
Joel Goldstick


More information about the Tutor mailing list