Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to slip data but it happens to be tricky
example
Field A
A,B(a,b,c,d,f),C
X(a,b,c,d,f),Y,Z
expected output
Field A
A
B(a,b,c,d,f)
C
X(a,b,c,d,f)
Y
Z
can someone inject me with experience 😊
Take this injection, however, I am not sure if another dose would be required for better immunity. 😋
Load Replace(Splitted, '@', ',') as FinalString;
Load SubField(NewField,',') as Splitted;
Load
Left(FieldA, Index(FieldA, '(')) &
Replace(TextBetween(FieldA, '(', ')'),',','@')
& Right(FieldA, Len(FieldA)-Index(FieldA, ')')+1) as NewField
;
Load * Inline [
FieldA
A,B(a,b,c,d,f),C
X(a,b,c,d,f),Y,Z] (delimiter is '|')
Try this,
tab1:
LOAD * INLINE [
F1
"A,B(a,b,c,d,f),C"
"X(a,b,c,d,f),Y,Z"
];
Left Join(tab1)
LOAD *, Mid(F1,IterNo(),1) As C1, IterNo() As N1
Resident tab1
While IterNo() <= Len(F1)
;
Left Join(tab1)
LOAD *, If(C1='(','I', If(F1=Peek(F1) And Not C1=')',Peek(K1),'N')) As K1
Resident tab1;
Left Join(tab1)
LOAD F1,C1,K1,N1, If(C1=',',If(K1='I', '~',C1),C1) As C2
Resident tab1;
Left Join(tab1)
LOAD F1, Concat(C2,'',N1) As F2
Resident tab1
Group By F1;
tab2:
LOAD Replace(SubField(F2,','),'~',',') As FieldA
Resident tab1;
Drop Table tab1;
Output:
Take this injection, however, I am not sure if another dose would be required for better immunity. 😋
Load Replace(Splitted, '@', ',') as FinalString;
Load SubField(NewField,',') as Splitted;
Load
Left(FieldA, Index(FieldA, '(')) &
Replace(TextBetween(FieldA, '(', ')'),',','@')
& Right(FieldA, Len(FieldA)-Index(FieldA, ')')+1) as NewField
;
Load * Inline [
FieldA
A,B(a,b,c,d,f),C
X(a,b,c,d,f),Y,Z] (delimiter is '|')