My csv file :
id,name,package
1,sachith,16434646
2,nalaka,12347834
3,john,6574654
4,albert,834758
UpdateRecord
processor should change this into :
id,name,package
1,sachith,0434646
2,nalaka,0347834
3,john,old_pack
4,albert,old_pack
I used following replaceFirst
operation as custom property. /package
${field.value:replaceFirst('(^12)','0')
:replaceFirst('(^16)','0')
:replace(${field.value},'old_pack')
Here I used replace(${field.value())
as suggested here.
But my output is having :
id,name,package
1,sachith,0old_pack
2,nalaka,0old_pack
3,john,old_pack
4,albert,old_pack
Replacement Value Strategy : Literal Value
Record Reader : CSV
Schema Access Strategy : Use String Fields from Headers