Need Script For read multiple files(.txt) from a folder

Chris cwitts at gmail.com
Fri Mar 14 05:13:59 EDT 2008


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 /?
> Copies one or more files to another location.
>
> COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
>      [+ source [/A | /B] [+ ...]] [destination [/A | /B]]
>
>   source       Specifies the file or files to be copied.
>   /A           Indicates an ASCII text file.
>   /B           Indicates a binary file.
>   /D           Allow the destination file to be created decrypted
>   destination  Specifies the directory and/or filename for the new
> file(s).
>   /V           Verifies that new files are written correctly.
>   /N           Uses short filename, if available, when copying a file
> with a
>                non-8dot3 name.
>   /Y           Suppresses prompting to confirm you want to overwrite an
>                existing destination file.
>   /-Y          Causes prompting to confirm you want to overwrite an
>                existing destination file.
>   /Z           Copies networked files in restartable mode.
>
> The switch /Y may be preset in the COPYCMD environment variable. This
> may be overridden with /-Y on the command line.  Default is to prompt on
> overwrites unless COPY command is being executed from within a batch
> script.
>
> To append files, specify a single file for destination, but multiple
> files for source (using wildcards or file1+file2+file3 format).
>
> C:\Documents and Settings\Dennis Lee Bieber>
>
>         Note that last paragraph "To append files"
> --
>         Wulfraed        Dennis Lee Bieber               KD6MOG
>         wlfr... at ix.netcom.com             wulfr... at bestiaria.com
>                 HTTP://wlfraed.home.netcom.com/
>         (Bestiaria Support Staff:               web-a... at bestiaria.com)
>                 HTTP://www.bestiaria.com/

If you want to go that route you could also do: type *.txt >
output_file.txt



More information about the Python-list mailing list