Topic Options
#56916 - 04/04/19 11:23 AM split the data
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 324
Loc: Home
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
_________________________
Peace

Top
#56917 - 04/04/19 11:28 AM Re: split the data [Re: Sami786]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 471
Loc: Québec, Canada

Top
#56920 - 04/04/19 12:08 PM Re: split the data [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 324
Loc: Home
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


Edited by Sami786 (04/04/19 12:09 PM)
_________________________
Peace

Top
#56922 - 04/04/19 12:25 PM Re: split the data [Re: Sami786]
Jim Dornbos Offline
OL Expert

Registered: 07/23/08
Posts: 151
Loc: Flint, Michigan
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.

Top
#56926 - 04/04/19 12:57 PM Re: split the data [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 324
Loc: Home
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.
_________________________
Peace

Top
#56927 - 04/04/19 01:34 PM Re: split the data [Re: Sami786]
Jim Dornbos Offline
OL Expert

Registered: 07/23/08
Posts: 151
Loc: Flint, Michigan
&sInvoiceNumber := strip('-', trim(@(1,1,15)))

is what you're after, I think.

Top
#56928 - 04/04/19 03:42 PM Re: split the data [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 324
Loc: Home
That worked nicely - thank you for your help.
_________________________
Peace

Top