Focal Point
[SOLVED] TRIM/STRIP HELP

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6097009396

July 14, 2020, 02:58 PM
Jveselka
[SOLVED] TRIM/STRIP HELP
WF 8105m

Needs some code to TRIM leading characters before '-'. I only want the number after it?

ex.
HARRIS - 101
I will want the HARRIS in one column and 101 in the other.

Thanks
JV

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8105m
Windows, All Outputs
July 14, 2020, 05:39 PM
Waz
Try using TOKEN, check it out in the functions manual.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

July 14, 2020, 07:01 PM
jltz83od
We have used a combination of POSIT and SUBSTRING for something like this.

 
DEFINE
SPECIAL_CHARACTER/I3 = POSIT(NAME,256,'-',1,'I3');
FIRST_NAME/A24 = SUBSTRING(NAME,1,SPECIAL_CHARACTER-1);
LAST_NAME/A24 = SUBSTRING(NAME,SPECIAL_CHARACTER+1,(LENV(NAME,'I3')-SPECIAL_CHARACTER));
END
 



WebFOCUS 8.2.06, Windows
July 15, 2020, 09:17 AM
Jveselka
Thanks jltz83od! That worked.


WebFOCUS 8105m
Windows, All Outputs