Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I have a string like b-bghy-gnhytr-df-fgt.Need to split into 5 coloumns.
As well its size is not fixed..
Can any one help on this..
Hi there.
Look up the SubField() string function.
Kind regards,
Ernesto.
hi shiva,
As Ernesto mentioned use subfield function, below is script which will help you split into 5 columns
trigger:
load * inline [
word, number
b-bghy-gnhytr-df-fgt, 1
];
trigger2:
load number,
SubField(word,'-',1) as one,
SubField(word,'-',2) as two,
SubField(word,'-',3) as three,
SubField(word,'-',4) as four,
SubField(word,'-',-1) as five
resident trigger;
RESULT
SCRIPT
a:
load * inline [
word, number
b-bghy-gnhytr-df-fgt, 1
];
b:
load number,
SubField(word,'-') as newfield
resident a
;
Hi,
one solution could be:
tabStrings:
Generic
LOAD RecNo() as %ID,
'Sub'&Autonumber(RowNo(),RecNo()) as ColNo,
SubField(string,'-') as substring
Inline [
string
b-bghy-gnhytr-df-fgt
sdf-sfdsfd-sdf-sdf-sf
sdfs-sfd-sdf-sf
egr-rht-tzj
tjt-iuk
wre
wrer-retz-zu-wre-tzo
zuk-rt-we-jhk-fh-etr
];
hope this helps
regards
Marco
Use SUBFIELD Function like below image
Use SubFiled() Function
Any luck testing the proposed solutions so far?
Hi yes i tried and its working
Hi,
good to hear.
Please close this thread.
thanks
regards
Marco