cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Pilgrim

Escape \ while replacing variables from text file?

I am using the Modify Text File - Single File action and replacing IA variables inside the file.
Some of these variables are folder paths and I want them to comeup with \\ instead of a \

eg:

abcLocation=$USER_MAGIC_FOLDER_4$
if $USER_MAGIC_FOLDER_4$ = c:\abc\def\ghi

I want the file to show,
abcLocation=c:\\abc\\def\\ghi

Is there a way to do this in IA2011?

thanks
Labels (1)
0 Kudos
2 Replies
Highlighted
Flexera beginner

Re: Escape \ while replacing variables from text file?

Hi,

There are several ways to do this... read help files for more details about each

- "Modify Text File action" Search & Replace strings: Search for "\" & replace with "\\"
- "Modify String" Plug-in: Convert "$USER_MAGIC_FOLDER_4$" and get $MS_STRING_DBS$ that will contain double backslashes.
- Use custom code action to create your own convert
- ...etc...

--Jerome
0 Kudos
Highlighted
Pilgrim

Re: Escape \ while replacing variables from text file?

thanks jerome.
I used the 2nd option from the ones you specified and it works like a charm 🙂
0 Kudos