|
How to subtract two dates in a file to get number of days?
I have a sample file with six fields delimited by commas below:
1astname1,firsname1 , 216057926,102,07/03/10,07/04/10
lastname2,firstname2 , 211968262,105,07/01/10,07/04/10
lastname3,firstname3, 214783220,113,06/29/10,07/04/10
field 5 is first date
field 6 is last date
I need to subtract field6 - field5 to get the number of days and then append it as field7 to the file. Desired result is below:
1astname1,firsname1 , 216057926,102,07/03/10,07/04/10,1
lastname2,firstname2 , 211968262,105,07/01/10,07/04/10,3
lastname3,firstname3, 214783220,113,06/29/10,07/04/10,5
I appreciate any help.
|