Hi,
I have a scenario like, I need to replace a hyphens(-) for date field alone in the file.
I have minus(-) sign for other fields it should remain as such, only for date fields hyphens must be removed. Please find the content for the file below:
sample.txt:
-----------
KSA,B12467428,2010-06-04,2010-06-04,2011-06-04,ITI, ,N,2011-06-04,AT,IFGC,13097573, ,001,OUT,1, 0000000000627.00, , , , 0000000000000.00, ,,, -0000000000627.00, 0000000000000.00, 0000000000532.95, 0000000000094.05, 00000.1500, 0000000000000.00
KSA,M03201053,2009-06-11,2009-06-11,2010-06-11,IMP,P,R,2010-06-11,ME,IFGC,06490230, ,013,XLL,1,-0000000000657.00, , , , 0000000000000.00, ,,,-0000000000657.00, 0000000000000.00,-0000000000545.31,-0000000000111.69, 00000.0000, 0000000000000.00
Expect results from the sample.txt: (only for date values hyphens(-) are removed)
---------------------------------------------------------------
KSA,B12467428,20100604,20100604,20110604,ITI, ,N,20110604,AT,IFGC,13097573, ,001,OUT,1, 0000000000627.00, , , , 0000000000000.00, ,,, -0000000000627.00, 0000000000000.00, 0000000000532.95, 0000000000094.05, 00000.1500, 0000000000000.00
KSA,M03201053,20090611,20090611,20100611,IMP,P,R,20100611,ME,IFGC,06490230, ,013,XLL,1,-0000000000657.00, , , , 0000000000000.00, ,,,-0000000000657.00, 0000000000000.00,-0000000000545.31,-0000000000111.69, 00000.0000, 0000000000000.00
Please help me to achieve this using unix command, because as i am new bee to scripting.
Thanks very much in advance.
KK