Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have a string, and i need to check whether that string contains specific strings and rename it.
StringName Renamed_string
FTC MNC and CC refund_23-03-2017_29-03-2017 MNC and CC
NC-MNC_23-03-2017_29-03-2017 MNC
Y MNC and CC_23-03-2017_29-03-2017 MNC and CC
WRTE MNC_23-03-2017_29-03-2017 MNC
WRTE MNC and CC_23-03-2017_29-03-2017 MNC and CC
MNC_23-03-2017_29-03-2017 MNC
Y-MNC & CC_23-03-2017_29-03-2017 MNC and CC
MNC refund_23-03-2017_29-03-2017 MNC
MNC & CC_23-03-2017_29-03-2017 MNC and CC
MNC_23-03-2017_29-03-2017 MNC
MNCCC_23-03-2017_29-03-2017 MNC and CC
CC_23-03-2017_29-03-2017 CC
If in given string it contains only MNC, i need renamed string to be MNC.
If it contains both MNC and CC, i need to rename string as MNC and CC.
This renamed string is to added as onemore column to table.
Script;
Load StringName;
SQL SELECT StringName
from MyTable;
How could i do this?.
May be this?
LOAD StringName, If(SubStringCount(StringName,'MNC') and SubStringCount(StringName,'CC'),'MNC CC','CC') as StringName1 Inline [
StringName
FTC MNC and CC refund_23-03-2017_29-03-2017
NC-MNC_23-03-2017_29-03-2017
Y MNC and CC_23-03-2017_29-03-2017
WRTE MNC_23-03-2017_29-03-2017
WRTE MNC and CC_23-03-2017_29-03-2017
MNC_23-03-2017_29-03-2017
Y-MNC & CC_23-03-2017_29-03-2017
MNC refund_23-03-2017_29-03-2017
MNC & CC_23-03-2017_29-03-2017
MNC_23-03-2017_29-03-2017
MNCCC_23-03-2017_29-03-2017
CC_23-03-2017_29-03-2017
];
Hi Supriya,
can you elaborate the query?
you saying you need to know the string is same are renamed?
Regards
Sathish
Hi,
If in given string it contains only MNC, i need renamed string to be MNC.
If it contains both MNC and CC, i need to rename string as MNC and CC.
This renamed string is to added as onemore column to table.
May be this?
LOAD StringName, If(SubStringCount(StringName,'MNC') and SubStringCount(StringName,'CC'),'MNC CC','CC') as StringName1 Inline [
StringName
FTC MNC and CC refund_23-03-2017_29-03-2017
NC-MNC_23-03-2017_29-03-2017
Y MNC and CC_23-03-2017_29-03-2017
WRTE MNC_23-03-2017_29-03-2017
WRTE MNC and CC_23-03-2017_29-03-2017
MNC_23-03-2017_29-03-2017
Y-MNC & CC_23-03-2017_29-03-2017
MNC refund_23-03-2017_29-03-2017
MNC & CC_23-03-2017_29-03-2017
MNC_23-03-2017_29-03-2017
MNCCC_23-03-2017_29-03-2017
CC_23-03-2017_29-03-2017
];
Hi Anil,
sorry for ask,
if the data is in database we should write like above are need to change something.
Regards
sathish
Why Sorry, When we open things then we learn.
Yes, We can do same thing
Connect String
//Preceding Load here like as i mentione
Load * From Table;
Select * From Table;
Hi,
ok i got the point.
Regards
Sathish