Sign in to follow this  
Followers 0
Cyote101

xml File merge

3 posts in this topic

#1 ·  Posted (edited)

Hello all, Marry Christmas/Happy New Year!!!!!

I have a couple questions for the board. I'm working on a little program and i need help with an update feature. I want to build a script that will extract data from a txt document and import the data to another txt document. And i would like some advice on where to start. Here is an example of what i would like to do.

Here is a directory tree of my project

\working Directory

-Reports\

-Viewer.exe

-autoit.exe

-catolog.txt

Okay in side the "working directory\report\" There are 10 txt files, these files are xml data files and have the location, description and formating for different images and files. I want the Autoit.exe to extract that information from those "data" files and insert them into the catolog.txt file. To make things simpler i could also change the file extentions from xml or txt to .dta just so the autoit does not scan the wrong files. They will need to be inserted after the last "//101//" entry in the catolog file. This will not be at the end of the file and it will always be changing. The viewer.exe will then use the catolog.txt to navigate through the users liabrary and such.

In essence what I'm tring to make is an xml updater. I have a liabrary of books and reports that the user can download one at a time. They are all viewed with this Viewer software i made. This autoit.exe i'm working on will add any new files to the catolog and make it so the user can easily access all of his reports.

Thanks,

Any help would be awsome!!!!

Edited by Cyote101

Share this post


Link to post
Share on other sites



So, have you downloaded eltorro's _XMLDOMWrapper.au3 and tried the _XML* functions yet? That will handle all the XML stuff, and the text stuff is just native File and String functions.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks. I checked it out. It's a bit out of my league. what i'm trying to do is actually very simple. I don't know how to do it but it's simple for some one out there.

so i have the following directory tree

\Sales Reports\(This is the root directory for my application) And it contains the following

-Viewer.exe (this is a flash projector. It's an xml gallery)

-Update.exe (The autoit Script)

-catolog.xml(This is the xml file the viewer.exe uses)

-\Reports\ (This is a folder called "reports", in this folder are different folders and txt files that have the content for the gallery.

The user will download new reports and save

them to this folder. Each Report will have the following in the download. 1 txt file (this is the xml data for the report, this is

used by the flash gallery) and 1 folder of images and files. So when a user downloads a new report and runs the Update.exe

That's the Tree. This is how the Files should work.

Each download, or report has at least two parts, a txt file with the xml content and a folder containing all the files.There can be any number of these txt files in the reports directory. they all have different names. for example shoes.txt,cars.txt etc.

Here is an example of one of the txt files. This txt file is called Aug Shoe Report.txt

// Shoe Report aug 2010

// www.myreports.com

//101//

<ReportPages>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

<page src="pages/img01.swf"></page>

</ReportPages>

I would like the contents of the txt file copied and inserted into the catolog.xml file after //101//. (//101//, is just a tag i will put in the xml file so the autoit script knows where to insert the data.

So i hope this is making sense so far.

The update.exe will go through all the txt files in the root\reports\ Directory, extract all the data after the //101// tag and paste them one by one in the catolog.xml file after the //101// tag. All of this should be done with no input by the user. So essentially it's just a copy and paste thing.

Any help would be great, thanks. I'm doing all this because flash does not have the ability to write it's own xml files. or at least i don't know how to do this. Thanks again for your help.

Edited by Cyote101

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  
Followers 0