Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
i have source table record like this
Source Records |
---|
"AA"-"AB"-"CC"-"DD" |
"AM"-"AD" |
"AH"-"AN"-"BL" |
I need to load the data below mentioned format.
Expected Result |
---|
AA |
AB |
CC |
DD |
AM |
AD |
AH |
AN |
BL |
try this
Subfield(keepchar(Field,'ABCDEFGHIJKLMNOPQRSTUVWXYZ-'),'-') as Result
May be try this:
PurgeChar(SubField(Source, '-'), Chr(34)) as Expected
For your sample:
Table:
LOAD *,
PurgeChar(SubField([Source Records], '-'), Chr(34)) as Expected;
LOAD * INLINE [
Source Records
'"AA"-"AB"-"CC"-"DD"'
'"AM"-"AD"'
'"AH"-"AN"-"BL"'
];
Thanks Sunny T
Some data have number also
"AH#2"-"AN#6"-"BL#8"
Would this be the output you would want to see?
Still using the same script:
Table:
LOAD *,
PurgeChar(SubField([Source Records], '-'), Chr(34)) as Expected;
LOAD * INLINE [
Source Records
'"AA"-"AB"-"CC"-"DD"'
'"AM"-"AD"'
'"AH"-"AN"-"BL"'
'"AH#2"-"AN#6"-"BL#8"'
];
try this
Subfield(keepchar(Field,'ABCDEFGHIJKLMNOPQRSTUVWXYZ-'),'-') as Result