PDA

View Full Version : Escape \ while replacing variables from text file?



suminub
05-22-2012, 05:42 PM
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

jerome_IA
05-23-2012, 02:19 AM
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

suminub
05-30-2012, 03:21 PM
thanks jerome.
I used the 2nd option from the ones you specified and it works like a charm :)