Need Script For read multiple files(.txt) from a folder
jayapal.d at gmail.com
Sat Mar 15 05:26:50 CET 2008
On Mar 14, 9:45 pm, Jeff Schwab <j... at schwabcenter.com> wrote:
> Chris wrote:
> > On Mar 14, 8:36 am, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> >> On Thu, 13 Mar 2008 21:28:18 -0700 (PDT), jai_python
> >> <jayapa... at gmail.com> declaimed the following in comp.lang.python:
> >>> hi frenz I Need a Python Script For read multiple files(.txt) from a
> >>> folder and write it in a single text file....
> >> If you are on windows, just open a command prompt and use the
> >> standard copy command...
> >> C:\Documents and Settings\Dennis Lee Bieber>copy /?
> > If you want to go that route you could also do: type *.txt >
> > output_file.txt
> On Unix, cygwin, etc:
> cat dir/*.txt > output.txt
> Or if you need "deep" copy:
> cat $(find dir -name '*.txt') > output.txt
> You could write a portable solution in Python (as in Martin Laloux's
> post), but most modern command-line environments have similar (but not
> identical) support for globbing and redirecting files. If you're
> getting the glob pattern from a user, they may expect subtly
> platform-dependent behaviors, in which case portability might not as
> important as native feel.
ya its working.... thanks for all ur help
More information about the Python-list