Do you want to extract NSW and SS from the string or do you want to dynamically extract the string after the first pipe and the string after the second pipe?
if you want to store NSW and SS in a variable then just say v1 = 'NSW' and v2 = 'SS'!
Of course I know this isn't what you want to do but it could be read in that way!
Assuming you want to find the string after the pipes and assuming the full string always includes 2 pipes and the string you want to extract always comes after the pipes and the string you want to extract after the first pipe is always 3 characters long and 2 characters long after the second pipe then something like:
Code: Select all
vScan = subst('PEPSI-MS-0870-3/PO:4500752654.30|NSW|SS', scan('|', 'PEPSI-MS-0870-3/PO:4500752654.30|NSW|SS') + 1,long('PEPSI-MS-0870-3/PO:4500752654.30|NSW|SS'));
vScanNSW = subst(vScan,1,3);
vScanSS = Subst(vScan,5,2);
may suffice.
But more information would mean less assumptions on my part!
cheers, mark