Hi, I'm a beginner, and what I want to accomplish is this: 1. For all files under several folders, do some processing (using an existing program). The program will output one line of text for each file. 2. Store the output of all files in one file. It would be great if someone can give me a crash start on accomplishing this. If you think there is a definitely better tool than Python for doing this, please tell me so. I just heard that Python or Perl are better in these kind of jobs. Thanks.
On 2005-07-11, b83503104@yahoo.com <b83503104@yahoo.com> wrote: > I'm a beginner, and what I want to accomplish is this: > > 1. For all files under several folders, do some processing (using an > existing program). The program will output one line of text for each > file. > > 2. Store the output of all files in one file. > > It would be great if someone can give me a crash start on accomplishing > this. If you think there is a definitely better tool than Python for > doing this, please tell me so. I just heard that Python or Perl are > better in these kind of jobs. Using bash and find: (find path1 path2 path3 -type f -exec existingProgram {} \;) >outputFile -- Grant Edwards grante Yow! You can't hurt at me!! I have an ASSUMABLE visi.com MORTGAGE!!
use os.path.walk() or os.walk() Tuxlover