Hello I am new to using the Macro Scheduler 9.0
I had used the evaluation version and have just gotten the
Pro version. This is a very good program, but I am very new to scripting and programming. I have been trying to figure out how to do this for a while. I have looked at all the forums and help files and not quite grasping how to do this.
The items listed below are in a notepad text file:
@C:\My Stuff\Data\quicken 99 deluxe edition\every use backup - 02/20/07 1402
@C:\My Stuff\Data\quicken 99 deluxe edition\every use backup1 - 03/01/07 0920
C:\My Stuff\Data\quicken 99 deluxe edition\every use backup2 -
What I am trying to do is find the "C:\My Stuff\Data\quicken 99 deluxe edition\every use backup" without the "@" preceding it. I then would copy the "C:\My Stuff\Data\quicken 99 deluxe edition\every use backup" portion of the line and paste it to another program. I would then put a "@" in front of the "C:\My Stuff\Data\quicken 99 deluxe edition\every use backup" in the same line and then time and date stamp it at the end of the line like the first 2 entries seen above. When all 3 of the "C:\My Stuff\Data\quicken 99 deluxe edition\every use backup" have a "@" then I would like to delete all 3 "@" in front of the "C:\My Stuff\Data\quicken 99 deluxe edition\every use backup" as well as the time and date stamp at the end of the lines. I would then do a search for the "C:\My Stuff\Data\quicken 99 deluxe edition\every use backup" portion of the line and do as stated before. I can't figure out how to be able to capture and copy "C:\My Stuff\Data\quicken 99 deluxe edition\every use backup". I would like to be able to use the notepad text file that I have these items in to manipulate the strings.
I have tried to do some scripting. This is the best I could come up with. I would appreciate any help.
Let>k=1
Label>start
Wait>.5
ReadLn>C:\Documents and Settings\Cal\My Documents\Financial Goals.txt,k,line
Position>C:\My Stuff\Data\quicken 99 deluxe edition\every use backup,%Line%,1,r1,TRUE
If>Position>{(C:\My Stuff\Data\quicken 99 deluxe edition\every use backup)}=1,finish
If>line=##EOF##,finish
Let>k=k+1
Goto>start
Label>finish
Message>DONE.
String Manipulation
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Some untested psuedo-code:
Not final code. Just something to get you started and give you some ideas.
When modifying a text file you actually read from the original file, write out to a new file and then delete the old file, and rename the new to the old afterwards ... easiest and safest.
Code: Select all
ReadLn>filename,k,line
Pos>@,line,1,p
If>p=1
//this line starts with @, so just write it to new file
WriteLn>newfile,r,line
else
Pos> -,line,1,p
Let>p=p-1
MidStr>line,1,p,path
//Paste %path% to other program ...
//need some code to count consecutive @ and create counter
//if path same as last, increment counter ...
//Now add the @ and date
Day>dy
Month>mh
Year>yr
Hour>hr
Min>mn
Let>newline=@%path% - %mh%/%dy%/%yr% %hr%%mn%
//write to new file
WriteLn>newfile,r,line
Endif
//at end, delete input filename, and move newfile to old file
DeleteFile>filename
MoveFile>newfile,filename
When modifying a text file you actually read from the original file, write out to a new file and then delete the old file, and rename the new to the old afterwards ... easiest and safest.
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?