Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a field similar to
Data
------
ABC
ABC (V645)
DHFE
Corporate
AWS (A598234)
Stock
BCC (V10)
How do I separate Text and Alphanumeric values into two different fields in the script?
I tried IsNum and Istext but they did not work
Data:
Load *,
if(not isnum(if(len(trim(KeepChar(Field,'0123456789')))>0,KeepChar(Field,'0123456789'))) and
istext(if(len(trim(KeepChar(Field,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')))>0,
KeepChar(Field,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'))),Field) as Text,
if(isnum(if(len(trim(KeepChar(Field,'0123456789')))>0,KeepChar(Field,'0123456789'))) and
istext(if(len(trim(KeepChar(Field,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')))>0,
KeepChar(Field,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'))),Field) as AlphaNumeric
Inline [
Field
ABC
ABC (V645)
DHFE
Corporate
AWS (A598234)
Stock
BCC (V10) ];
Data:
Load *,
if(len(TextBetween(Data,'(',')'))>0,Data,null()) as AN,
if(len(TextBetween(Data,'(',')'))=0,Data,null()) as Text;
Load *
Inline [
Data
ABC
ABC (V645)
DHFE
Corporate
AWS (A598234)
Stock
BCC (V10) ];
You have received two responses to your post, we would greatly appreciate it if you would close out the thread by using the Accept as Solution button on the post(s) that helped. If neither did help, please leave an update post on what you still need.
Regards,
Brett