Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > read output and store in file

Reply
Thread Tools

read output and store in file

 
 
b83503104@yahoo.com
Guest
Posts: n/a
 
      07-11-2005
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.

 
Reply With Quote
 
 
 
 
Grant Edwards
Guest
Posts: n/a
 
      07-11-2005
On 2005-07-11, http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> 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!!
 
Reply With Quote
 
 
 
 
tuxlover
Guest
Posts: n/a
 
      07-11-2005
use os.path.walk() or os.walk()

Tuxlover

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File.read(fname) vs. File.read(fname,File.size(fname)) Alex Dowad Ruby 4 05-01-2010 08:20 AM
Read a file and store bits into an array Sintek Java 1 05-03-2009 05:14 AM
read and store from unknown file name carmelo C++ 4 03-02-2008 03:56 AM
File open, read and store in Hash, efficient? Kev Ruby 5 03-09-2007 10:52 AM
ow can i use fgets to read and ignore the first two lines of a file and output into another file Justme C Programming 9 10-01-2006 02:26 PM



Advertisments