Problem using Separate
Moderators: JRL, Dorian (MJT support)
Problem using Separate
Am I doing something wrong or is there a better way to do this?
I pull a series of variables as one text string from a VBScript. The string looks like this.
21.88,71.38,39,10,79,99,99,99
The string contains 8 variables separated by a commas. I want to separate them into individual variables. I tried to use the Separate> command but it doesn't seem work with a , as the delimiter.
Separate>RetValIs,,,new_values
doesn't work.
Is there a way to separate these variables? The 2 digit numbers are sometimes only 1 so the MidStr> command does not work all the time.
Thanks
-Joe
I pull a series of variables as one text string from a VBScript. The string looks like this.
21.88,71.38,39,10,79,99,99,99
The string contains 8 variables separated by a commas. I want to separate them into individual variables. I tried to use the Separate> command but it doesn't seem work with a , as the delimiter.
Separate>RetValIs,,,new_values
doesn't work.
Is there a way to separate these variables? The 2 digit numbers are sometimes only 1 so the MidStr> command does not work all the time.
Thanks
-Joe
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I tried this and got the same problem: it did not work.
I added Let>DL=, and used %DL% as a variable for the delimiter, same results.
I tried with a semicolon (;) and it worked fine.
I tried with an underscore (_) and it worked fine.
I tried changing delimiter of , to "," and got an unending loop.
Hmmm, might actually be a bug here? Maybe some more tests will explain..... 

I added Let>DL=, and used %DL% as a variable for the delimiter, same results.

I tried with a semicolon (;) and it worked fine.

I tried with an underscore (_) and it worked fine.

I tried changing delimiter of , to "," and got an unending loop.



Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Hello Joe.....would you be the original "Guest", signed Joe, who started this problem
Just curious........if Yes, thanks for the name
Temporary work around until this is corrected would be to do a Search and Replace. Replace the , with a ; or some other unique character. Then do the Separate process. Replace can be done using VBS script in the Macro Script.
Easiest solution is to use Visual Basic Replace function
=================
There is no need to rename the result. It was just done here to display a message. The next line is perfectly acceptable:
VBEval>Replace("%String1%",",",";"),String1

Just curious........if Yes, thanks for the name

Temporary work around until this is corrected would be to do a Search and Replace. Replace the , with a ; or some other unique character. Then do the Separate process. Replace can be done using VBS script in the Macro Script.

=================
==================VBSTART
VBEND
Let>String1=21.88,71.38,39,10,79,99,99,99
VBEval>Replace("%String1%",",",";"),String2
Message>%String1%%CRLF%%CRLF%has been changed to %CRLF%%CRLF%%String2%
There is no need to rename the result. It was just done here to display a message. The next line is perfectly acceptable:
VBEval>Replace("%String1%",",",";"),String1
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Honestly! Just do this:
Let>delim=,
Separate>RetValIs,delim,new_values
Let>delim=,
Separate>RetValIs,delim,new_values
MJT Net Support
[email protected]
[email protected]
If that's the case, I guess a bunch of folks would expect that both should work!?
Support:
Let>delim=,
Separate>RetValIs,delim,new_values
Let>DL=,
Separate>RetValIs,%DL%,new_values
I can't see a difference on what support has advised and what Bob offered ...
Support:
Let>delim=,
Separate>RetValIs,delim,new_values
coded it would have looked like this:[Bob] I added Let>DL=, and used %DL% as a variable for the delimiter, same results [it didn't work].
Let>DL=,
Separate>RetValIs,%DL%,new_values
I can't see a difference on what support has advised and what Bob offered ...

- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I just tried Let>delim=, and it worked.
I retried my Let>DL=, and it failed.
I removed the % from around DL in my Separate function and it worked!
So now I did Let>VAREXPLICIT=1
And Separate fails with and without the %.
Something seems wrong here.
I suspect it has something to do with VAREXPLICIT.
This fails when VAREXPLICIT=1:
Separate>files,DL,file_names
This also fails when VAREXPLICIT=1
Separate>files,%DL%,file_names
This fails when VAREXPLICIT=0
Separate>files,%DL%,file_names
This is the only time it is good, VAREXPLICIT=0
Separate>files,%DL%,file_names
And using , vs. a variable always fails.
Separate>files,,,file_names
Additional comment: Watch List always shows "DL=," no matter what the setting is for VAREXPLICIT.
This looks like a problem for Marcus?


I retried my Let>DL=, and it failed.

I removed the % from around DL in my Separate function and it worked!

So now I did Let>VAREXPLICIT=1
And Separate fails with and without the %.



This fails when VAREXPLICIT=1:
Separate>files,DL,file_names
This also fails when VAREXPLICIT=1
Separate>files,%DL%,file_names
This fails when VAREXPLICIT=0
Separate>files,%DL%,file_names
This is the only time it is good, VAREXPLICIT=0
Separate>files,%DL%,file_names
And using , vs. a variable always fails.
Separate>files,,,file_names
Additional comment: Watch List always shows "DL=," no matter what the setting is for VAREXPLICIT.
This looks like a problem for Marcus?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!