Double string search

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ghost24
Newbie
Posts: 9
Joined: Mon Oct 22, 2012 11:51 pm

Double string search

Post by ghost24 » Thu Jan 24, 2013 2:03 am

Hi,

i have this problem!
..befoe.. sorry about my bad english...

i have a .ini file like this example here.

The questions is... how can i find the nr. that have the same index ..here "nextrun".

i need as result.. the number [] and the "nextrun" value.

At this example the nr. 1 and 2 have the same "nextrun".

How can i search about this?

[1]
nextrun=03:02:00
aktiv=1
waitnr=wt1
[2]
nextrun=03:02:00
aktiv=1
waitnr=wt1
[3]
nextrun=05:02:00
aktiv=1
waitnr=wt1
[4]
nextrun=04:02:00
aktiv=1
waitnr=wt2


thx for you answere and help!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jan 24, 2013 10:39 am

Are you saying you want to extract all section headers (the bit in square brackets) and their nextrun values.

Or are you saying you want to find which sections contain a specific nextrun value (e.g. "give me a list of numbers whose nextrun equals 03:02:00")
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

ghost24
Newbie
Posts: 9
Joined: Mon Oct 22, 2012 11:51 pm

Post by ghost24 » Thu Jan 24, 2013 9:25 pm

i will find all the bit in square brackets that have the same nextrun value.

The reason is... the nextrun time is a changing value (the System change this time, from time to time).
And so, some times i have some bit in square brackets that have the same nextrun time. BUT this one i want to excluded.

So i need a script that check all the nextrun time against each other nextrun time and mark the double or write the bit in square brackets from this one to file or......!

This script i need, must not run all the times. i will trigger manual.


Here is the ini file with header...
**************************
//*** Variablen declaration ***

//Dynamicvariable

[task_all]
anzahl=5

[wt1]
waittime=60
[wt2]
waittime=100
[wt3]
waittime=200

[1]
nextrun=03:02:00
name=Test.exe
todo=Test.exe
aktiv=1
waitnr=wt1
[2]
nextrun=03:02:00
name=Test2.exe
todo=Test2.exe
aktiv=1
waitnr=wt1
[3]
nextrun=03:02:00
name=Test3.exe
todo=Test3.exe
aktiv=1
waitnr=wt1
[4]
nextrun=03:02:00
name=Test4.exe
todo=Test4.exe
aktiv=1
waitnr=wt1
[5]
nextrun=03:02:00
name=Test5.exe
todo=Test5.exe
aktiv=1
waitnr=wt1
...
...
...
...
...
**************************

the script can set a value a the same ini file.. example:

**************************
**************************
//*** Variablen declaration ***

//Dynamicvariable

[task_all]
anzahl=5

[wt1]
waittime=60
[wt2]
waittime=100
[wt3]
waittime=200

[1]
nextrun=04:02:00
name=Test.exe
todo=Test.exe
aktiv=1
waitnr=wt1
double=0
[2]
nextrun=03:02:00
name=Test2.exe
todo=Test2.exe
aktiv=1
waitnr=wt1
double=1
[3]
nextrun=03:02:00
name=Test3.exe
todo=Test3.exe
aktiv=1
waitnr=wt1
double=1
[4]
nextrun=05:02:00
name=Test4.exe
todo=Test4.exe
aktiv=1
waitnr=wt1
double=0
[5]
nextrun=03:02:00
name=Test5.exe
todo=Test5.exe
aktiv=1
waitnr=wt1
double=1
...
...
...
...
...
**************************

ghost24
Newbie
Posts: 9
Joined: Mon Oct 22, 2012 11:51 pm

please close the thread ore delet.....

Post by ghost24 » Tue Jan 29, 2013 1:07 am

please close the thread ore delet.....

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts