split the data

Posted by: Sami786

split the data - 04/04/19 11:23 AM

Hi, I need a quick help on removing acharacter from a data selection.

my data selection looks like
ABC-123456789
I would like to save this data selection without the (-) into a variable to look like ABC123456789. My PressTalk code is incorrect.

&sInvoiceNumber := trim(@(1,1,3)+ (@(1,5,15)))

or there might be a way to grab the data and remove the dash right away?

Your help is appreciated.

THANKS
Posted by: Jean-C├ędric

Re: split the data - 04/04/19 11:28 AM

Look at Strip function
Posted by: Sami786

Re: split the data - 04/04/19 12:08 PM

I tried the link but it's not working for me for some reason.

&sInvoiceNumber := trim(@(1,1,15))
show(strip('-',&sInvoiceNumber))

%&sPDFInvoiceName:='C:\\Temp\\'+ &sInvoiceNumber + '-Application.pdf'

image name is ABC123456789-Application.pdf
Posted by: Jim Dornbos

Re: split the data - 04/04/19 12:25 PM

So is that solution working for you or are you still having trouble? Looks like the image name is coming out just like you asked.
Posted by: Sami786

Re: split the data - 04/04/19 12:57 PM

this solution is not working for me , for some reason the image is not pulled out from C drive because the dash is not stripped I think.
Posted by: Jim Dornbos

Re: split the data - 04/04/19 01:34 PM

&sInvoiceNumber := strip('-', trim(@(1,1,15)))

is what you're after, I think.
Posted by: Sami786

Re: split the data - 04/04/19 03:42 PM

That worked nicely - thank you for your help.