Jump to content

Change XML file


gripper
 Share

Recommended Posts

I am at a loss on this one and I am looking for some advice.

I have a program that I can start and control with Autoit without any problems but there is a procedure I need to add.

The settings for the program is from an XML file. One of the parameters is a settings that allows me to search back to a particular date. In this instance I want to go back 1 day from the current day and set that parameter.

I use this program every day and only want it to search and pull info from the last 24 yours (since the last search)

For instance here is the current setting line in the XML file "<beginTimePicker>10/26/2012 4:36:51 PM</beginTimePicker>"

WHAt I want to do is adjust the XML file before starting the program to "Current Day minus 1" So if I open it today, "10/26/2012 5:00:00 PM" I want it to run my search back to 10/25/2012 5:00:00 PM so I can pick up the data in the last 24 hours only which will be exported. There are about 500 lines on this XML file and I see the problem with finding the correct line to change.

I cannot figure out how to do this.

Any thoughts guys? I would really appreciate some ideals on this and some assistance in adding the right syntax to make this happen.

Link to comment
Share on other sites

OK I did some more work on this and I think I am down to a syntax issue I need assistance with.

#include <file.au3>

_FileWriteToLine("C:Usersuser1DesktopActive_Client_harvester.xml", 426, "NEED HELP HERE" ,1)

I was able to change the line but in the above systax "Need Help Here" I need to some how have this line equal "dateAdd('d', -1". So each time the script runs it will take the current date then - one day and then overwrite line 426 in my document.

I am looking for assistance in getting this code piece to work.

Thanks

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...