cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rootme
Level 4

FileGrep and FileInsertFile - adding an unwanted backslash character

Hi,

I have a non ini file in which I have to replace some parameters. For this I use Filegrep and FileInsertFIle.


filename = m_strJBossDepl ^ "\\conf\\VM.properties";
a = "RETRIEVE_VIDEO_SERVER="^m_strRetrVS;

FileGrep ( filename, "RETRIEVE_VIDEO_SERVER=", svReturnLine, nvLineNumber, RESTART );
FileInsertLine (filename, a, nvLineNumber, REPLACE);


Initial VM.properties file
RETRIEVE_VIDEO_SERVER=http://70.97.166.114:8080/VMWebApp

m_strRetrVS="http://10.10.10.1:8080/VMWebApp"

After
RETRIEVE_VIDEO_SERVER=\http://10.10.10.1:8080/VMWebApp

That backslash before equal character is inserted. The m_strRetrVS variable contain only the good string "http://10.10.10.1:8080/VMWebApp".

Any ideas ?
Thanks,
Bianca
Labels (1)
0 Kudos
2 Replies
RobertDickau
Flexera Alumni

The ^ operator (used in your definition of a) assumes you're concatenating parts of a path, inserting backslashes between the pieces if there isn't already one. Perhaps use + instead?
0 Kudos
rootme
Level 4

RobertDickau wrote:
The ^ operator (used in your definition of a) assumes you're concatenating parts of a path, inserting backslashes between the pieces if there isn't already one. Perhaps use + instead?


Thank you 🙂

Bianca
0 Kudos