One of the primary reasons I'm looking at buying a tool like this is to automate a lot of webmaster duties - for instance webshots of pages in my directories, verifying links before publishing pages, etc.
I'd like to be able to read a set of values from a file - I see that there's an INI file read function, but I was hoping for something more along the lines of a CSV or XML format.
Is this something that's supported easily? Or is there a code snippet that would work well for this request?
A brief perusal through the forums came up empty, but then again, I'm really new so maybe I just missed it.
Reading Variables from a file
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
To read from CSV use the ReadLn and Separate Functions. See examples in help file. ReadLn reads a line from the file, Separate will explode the fields into variables given the delimiter (comma in the case of CSV). To read from Excel use DDE or VBScript. Many examples on these forums (Search for Excel). There's also a sample script showing how to read data from Excel that comes with Macro Scheduler.
Hope this helps.
Hope this helps.
Last edited by Marcus Tettmar on Sun Jun 18, 2006 2:43 pm, edited 1 time in total.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
.csv, comma delimited, is a bit tricky since the Macro Scheduler commands are also comma delimited, but Separate works well if you define the delimiter first like this:
Let>datafile=c:\test\mydata.csv
Let>delim=,
IfFileExists>%datafile%,next,finish
Label>next
Let>k=1
Label>start
ReadLn>%datafile%,k,line
If>line=##EOF##,finish
Separate>line,delim,data
MessageModal>Data Elements=%data_count% %data_1% %data_2% %data_3% %data_4%
Let>k=k+1
Goto>start
Label>finish
Let>datafile=c:\test\mydata.csv
Let>delim=,
IfFileExists>%datafile%,next,finish
Label>next
Let>k=1
Label>start
ReadLn>%datafile%,k,line
If>line=##EOF##,finish
Separate>line,delim,data
MessageModal>Data Elements=%data_count% %data_1% %data_2% %data_3% %data_4%
Let>k=k+1
Goto>start
Label>finish
Parsing XML
I think his question about .CSV/Excel was answered... but WHAT ABOUT XML??? That was the other part of his initial question above??
Anyone have any ideas?
Anyone have any ideas?