The code below is meant to get ten numbers from Excel. There is a String replace line that is used to remove CRLF characters.
Looking at the watch list the number is extracted from EXCEL.
This is watch I see in the watchlist
INBOUNDNUMBER1=8001234567
The result of the String replace line is as follows
INBOUNDNUMBER%K%=8001234567
This is not what I would expect.
/* Get Inbound Numbers from Excel */
Let>k=0
Repeat>k
Let>k=k+1
DDERequest>Excel,filename,R%xlRow%C2,InboundNumber%k%,4
StringReplace>InboundNumber%k%,CRLF,,InboundNumber%k%
If>InboundNumber%k%=,MainLoopExit
Length>InboundNumber%k%,nLength
If>nLength<>10,MainLoopExit
Let>xlRow=xlRow+1
Until>k=10
Issue with String replace
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Issue with String replace
You have to split that StringReplace into pieces. Like this.
Code: Select all
Let>Input=InboundNumber%k%
StringReplace>%Input%,CRLF,,Output
Let>InboundNumber%k%=Output
Yes, we have a Custom Scripting Service. Message me or go here
Re: Issue with String replace
Perfect. Thanks Dorian.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Issue with String replace
Always happy to help.
Yes, we have a Custom Scripting Service. Message me or go here