cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Brigham_Cook
Level 2

Action Conditional on Text File Search Results

I'd like to make an action execute or not depending on whether a specific line is present in an already-present text file, but I'm not sure even where to begin.

Here are the details:

Prior to installation, I check for the presence of an INI file in a specific location. If it is missing, the installer exits.

At install time, I'd like to check if there are 4 specific lines in the INI file. If the lines are there, then move on. If not, add the 4 lines. Adding the lines is not the problem; checking to see whether they already exist is the problem. Any ideas?
Labels (1)
0 Kudos
(1) Reply
pv7721
Level 20

For the existence of the file you've got a built-in condition...

For the line existence you might want to turn to local resources: for instance under Windows you've got the built-in FINDSTR command and on Unices the good ol' grep...
0 Kudos