f



read output and store in file

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.

0
b83503104 (212)
7/11/2005 9:31:24 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

2 Replies
270 Views

Similar Articles

[PageSpeed] 47

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!!
0
grante (5416)
7/11/2005 9:44:08 PM
use os.path.walk() or os.walk()

Tuxlover

0
tuxlover (5)
7/11/2005 9:53:56 PM
Reply: