Jump to content
Sign in to follow this  

Mutliple txt files copy and paste

Recommended Posts


Hello all, HAPPY NEW YEAR!!!!!!!!!!!!!

This is my second post on the board on this topic. My first post was apparently in the wrong place. Sorry about that. So after some feedback from the board I have found out a little more about what i want to do. So here we go.

I want to create a script that will go though a directory "..root\Reports\". in this directory there are a number of .txt files(shoes.txt,apples.txt etc) I want to go through each txt file one by one and copy everything after "//101//" and I would like to paste that into another file, "Catalog.xml" in the root directory after //101//.

All the formatting of the text in the files is already done all need to do is add these parts to the one file.

Any help or direction would be awesome!!


Example of Directory Tree

Viewer.exe (This is the application the used the catalog.xml file)

catalog.xml (This is the file that has the locations of all the content for the viewer program)

Reports (This is a Folder that hold all the content and their txt files with the manifests.)

Update.exe (This is the Autoit application i'm working on)

Thanks again folks for all your help on this

Share this post

Link to post
Share on other sites

$search = FileFindFirstFile("*.*")     ; here is the source path.

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    ;add here what you need to do with current file
;    MsgBox(4096, "File:", $file)

; Close the search handle

If you need to merge all files into one use FileRead inside While and FileWrite with mode 1 - Write mode (append to end of file)

Happy New Year.


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this