DSIS Posted July 24, 2008 Share 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. Link to comment Share on other sites More sharing options...
Andreik Posted July 24, 2008 Share 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)? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
DSIS Posted July 24, 2008 Author Share Posted July 24, 2008 What type of files (txt)? Link to comment Share on other sites More sharing options...
DSIS Posted July 24, 2008 Author Share Posted July 24, 2008 Yes Link to comment Share on other sites More sharing options...
Andreik Posted July 24, 2008 Share 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) When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Xandl Posted July 24, 2008 Share 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 Link to comment Share on other sites More sharing options...
DSIS Posted July 24, 2008 Author Share 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. Link to comment Share on other sites More sharing options...
DSIS Posted July 24, 2008 Author Share 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. Link to comment Share on other sites More sharing options...
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