DSIS Posted July 24, 2008 Posted July 24, 2008 I need to concatenate all the files in a directory into one large file. I do not know the names of the files. I only know the directory they are located. I am not sure where to start. Can someone point me in the right direction. Thanks.
Andreik Posted July 24, 2008 Posted July 24, 2008 I need to concatenate all the files in a directory into one large file. I do not know the names of the files. I only know the directory they are located. I am not sure where to start. Can someone point me in the right direction. Thanks.What type of files (txt)?
Andreik Posted July 24, 2008 Posted July 24, 2008 #include <File.au3> $FILES = _FileListToArray(@ScriptDir,"*.txt",1) $FILE = FileOpen(@ScriptDir & "\ALL.TXT",2) For $INDEX = 1 To $FILES[0] $FILE_OPEN = FileOpen(@ScriptDir & "\" & $FILES[$INDEX],0) $DATA = FileRead($FILE_OPEN) FileClose($FILE_OPEN) FileWrite($FILE,$DATA & @CRLF) Next FileClose($FILE)
Xandl Posted July 24, 2008 Posted July 24, 2008 Hello, this sounds like a dos commandline job. You could use cd /d c:\path\to\textfiles copy * c:\another\path\all.txt ciao Xandl
DSIS Posted July 24, 2008 Author Posted July 24, 2008 #include <File.au3> $FILES = _FileListToArray(@ScriptDir,"*.txt",1) $FILE = FileOpen(@ScriptDir & "\ALL.TXT",2) For $INDEX = 1 To $FILES[0] $FILE_OPEN = FileOpen(@ScriptDir & "\" & $FILES[$INDEX],0) $DATA = FileRead($FILE_OPEN) FileClose($FILE_OPEN) FileWrite($FILE,$DATA & @CRLF) Next FileClose($FILE) Thanks. With a few tweaks this worked well.
DSIS Posted July 24, 2008 Author Posted July 24, 2008 Hello,this sounds like a dos commandline job.You could usecd /d c:\path\to\textfilescopy * c:\another\path\all.txtciaoXandlThanks. I will try this.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now