Search String inside a ini file

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Ghost24de
Newbie
Posts: 13
Joined: Thu Aug 15, 2013 11:24 am

Search String inside a ini file

Post by Ghost24de » Thu Jan 28, 2016 10:19 pm

Hello,
i have a ini file with some informations.


Here is a small sniplet from the file (runtime.ini)

******************
[1]
gruppenr=0
nextrun=15:00:00
name=Intiligenter_Modus
aktiv=1
waitnr=wt4
webpageurl=%strFolderName%\PSNET\TaskingIMod.exe
Tasktype=1
timer=0
[2]
gruppenr=0
nextrun=09:46:00
name=HK Kill
aktiv=1
waitnr=wt3
webpageurl=D:\PSNET\HistoryKill_1u1_go.exe
pagexkoord=700
pageykoord=740
pageupcount=1
tasktype=1
[3]
gruppenr=0
nextrun=10:11:00
name=CClean
aktiv=1
waitnr=wt3
webpageurl=D:\PSNET\CCleaner_TK_go.exe
pagexkoord=700
pageykoord=740
pageupcount=1
tasktype=1

*******************
one Information is the nextrun. Ist a time like hh:mm:ss
Another variable that i have is a dynamic time in example 09:46:00
I must search inside this file for the value from the nextrun and if i find a time that is the same like the variable so a must have a Information like true or 1 or ....
I Need nothing mor, i must only know, is there a value=variable

I have search the Forum but i find nothing.

any other usee an idea or can solve it? I think its a small question but i dont know how... thanks a lot

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Search String inside a ini file

Post by JRL » Fri Jan 29, 2016 4:09 pm

There is a function called ReadiniFile> that might be useful for you.

However based on my interpretation of your stated need it might be easier to simply read the ini file in to the script as a variable then test the variable to see if the desired time is in the file.

Code: Select all

Let>vTime=09:46:00
ReadFile>Path\runtime.ini,vData

Separate>vData,nextrun=%vTime%,Test

If>Test_Count>1
  MDL>Time found
Else
  MDL>Time not found
EndIf

Ghost24de
Newbie
Posts: 13
Joined: Thu Aug 15, 2013 11:24 am

Re: Search String inside a ini file

Post by Ghost24de » Sun Jan 31, 2016 11:47 pm

Hi,
thanks a lot.
It works fine!

;-)

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