Consider the sample below:
BRANCH|TXN_ID|CUSTOMER|PROCESS_DATE|VALUE_DATE|AMOUNT|UPLOAD_DATE|NARRATIVE
1|23234|12343|20141030|20141030|2000|20141030|TEST
1|23234|12343|20141030|20141030|2000|20141030|TEST
1|23234|12343|20141030|20141030|2000|20141030|TEST
1|23234|12343|20141030|20141030|2000|20141030|TEST
1|23234|12343|20141030|20141030|2000|20141030|TEST
1|23234|12343|20141030|20141030|2000|20141030|TEST
1|23234|12343|20141030|20141030|2000|20141030|TEST
If I use sed 's/20141030/20141029/g', it will replace all instances of 20141030, including UPLOAD_DATE, which is not what I want.
From the net, the awk examples am getting only replace one instance of the string. I need to replace all instances in one go
So my question is, how can I replace the contents of column 4 and 5 (process date and value date) using a unix script while maintaining the format of the file? The result will be written into a new file.