Cyote101 Posted December 31, 2009 Posted December 31, 2009 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
GodlessSinner Posted December 31, 2009 Posted December 31, 2009 $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") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop ;add here what you need to do with current file ; MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($search) 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. _____________________________________________________________________________
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