Expanding Search to Subfolders

Grant Edwards grante at visi.com
Mon Jun 5 14:13:33 EDT 2006


On 2006-06-05, PipedreamerGrey <pipedreamergrey at gmail.com> wrote:

Just in case you really are trying to accomplish something
other than learn Python, there are far easier ways to do these
tasks:

> This is the beginning of a script that I wrote to open all the
> text files in a single directory, then process the data in the
> text files line by line into a single index file.

#!/bin/bash
cat *.txt >outputfile

> I'm now trying to the program to process all the text files in
> subdirectories, so that I don't have to run the script more
> than once.

#!/bin/bash
cat `find . -name '*.txt'` >outputfile

-- 
Grant Edwards                   grante             Yow!  An INK-LING? Sure --
                                  at               TAKE one!! Did you BUY any
                               visi.com            COMMUNIST UNIFORMS??



More information about the Python-list mailing list