Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have field in which values are like below
jaipur
imp. jaipur
Bearings
imp. Bearings
i want to exclude imp. from the values.. how can i achieve it
thanks
Hi,
Use replace()
try like
replace(fieldName,'imp.','')
Regards
Hi,
Use replace()
try like
replace(fieldName,'imp.','')
Regards
try this
ss:
LOAD * INLINE [
naem
jaipur
imp. jaipur
Bearings
imp. Bearings
];
Main:
LOAD * ,
PurgeChar(naem,'imp.') as new
Resident ss;
Hi Abhay
The answer from Max will work or you could also use the substring command.
Wouldn't use purgechar as it will also drop any other i,m or p's from the text
Thanks
Dan
Try with Replace()
replace(Field,'imp.','')
sureshqv we should not use Purgechar() in this case it will eliminate all the words with letter i, m , p and . You could see the same in your example where jaipur has become jaur
Hi,
May be it will full for you.
T1:
load * Inline [
ABC
jaipur
imp. jaipur
Bearings
imp. Bearings
];
LOAD *,
LTrim(Replace(ABC,'imp.','')) as new
Resident T1;
DROP Table T1;
Hi Try this,
T1:
LOAD * INLINE [
name
jaipur
imp. jaipur
Bearings
imp. Bearings
];
T2:
LOAD * ,
"Replace(name,'imp.','') as replace
Resident T1;
Apart from what is already said:
load *
,if(left(Field, 4) = 'imp.', trim(SubField(Field, 'imp.', 2)), trim(Field)) as Field2
,if(left(Field, 4) = 'imp.', trim(right(Field, len(Field) - 4)), trim(Field)) as Field3
inline [
Field
jaipur
imp. jaipur
Bearings
imp. Bearings
];
Result:
Check the attachment.
thnx avi fro ur clarification