cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lkhoney2003
Level 6

How to replace a line based on some text

I want to replace whole line based on some pattern. I mean i dont want to match whole line contents but wants to replace whole line.
please help!
Thanks in advance..
Labels (1)
0 Kudos
(7) Replies
pv7721
Level 20

You've got the Modify Text File - Single File action, with the Configure Search and Replace Strings, where you can search for the respective line and replace it with the line of your choice!...
0 Kudos
lkhoney2003
Level 6

My problem is not getting resolve by this feature. and the reason is that my line is dynamic and only some text is static. So I have to replace whole line based on that static text.
for eg. search text1 ("Myport=****") replace with text2 ("NewPort=9000")
TIA!!!
0 Kudos
pv7721
Level 20

Then you may want to use regexp (regular expressions) or custom code.
0 Kudos
silveroil
Level 2

what does regexp (regular expressions) or custom code mean ?
So I need to do it in another way or InstallAnywhere has other function to do with it?
0 Kudos
pv7721
Level 20

For regexp take a look here: http://community.flexerasoftware.com/showthread.php?t=190440&highlight=regexp
For Custom Code you may want to check the manual: IA has an API which allows you to add functionality that might not natively exist, using Java.
0 Kudos
silveroil
Level 2

pv7721 wrote:
For regexp take a look here: http://community.flexerasoftware.com/showthread.php?t=190440&highlight=regexp
For Custom Code you may want to check the manual: IA has an API which allows you to add functionality that might not natively exist, using Java.


Thanks for the response. Here is another question: how to package a static folder which contains dynamic files? Becuse new file may added in folder sometimes, but I just saw the static links for folder and file in installanywhere. Is there any way for installanywhere to locate the new file and package automatically without adding new file manually
0 Kudos
pv7721
Level 20

The solution to that would be SpeedFolders.
0 Kudos