Delimiter other than quotes for variables?

September 12, 2011 at 09:53:28
Specs: Windows 7, 3.0GHz, 8GB
Hi everyone,

I have an issue with a task I've asked about on this forum before. I have variables that need to be parsed to build a command line argument. The way I'm doing it now calls the command line to run a file, file2run.bat and contains 9 variables following, all encapsulated with double quotes. The issue is that one of the variables will have a double quote within the text and there is no way to prevent this from occurring when the variable is passed.

My question is, is there a way to delimit the variables that will be passed other than using double quotes?

Right now it looks something like this:

file2run.bat "<value1>" "<value2>" "<value3>" "<value4>" "<value5>(this value will look like this with "double quotes" in the variable)

Since the value once sent over will be text with quotes within the text, this is when the problem starts. As you can see, when it gets to the second set, it reads everything following as a new variable. So is there another delimiter than can be used to separate values or should I be using Perl to do this?

See More: Delimiter other than quotes for variables?

Report •

September 12, 2011 at 10:20:22
I'm not sure this will work, but have you tried doubling the double quotes?

Report •

September 12, 2011 at 10:25:17
Actually it will see the "" as blank and anything after the doubled double quotes as a new variable.

Report •
Related Solutions

Ask Question