Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Subtract 2 date columns in .csv file and get output as number of days

$
0
0
Hi,

I have one .csv file. I have 2 date columns present in file, column 2 and column 3.

I need to calculate how many days exist between 2 dates.

I am trying to subtract date column 2 from date column 3.
Eg: my file look likes

s.no, Start_date,End_Date
1, 7/29/2012,10/27/2012
2, 7/29/2012,8/11/2012

my output should be
90
13 like this.

I am not able to get command to calculate how many days exist between these 2 dates.
after that, As i need to check how many sundays exists between the dates. so I will divide number of days/7.
Please help.

Viewing all articles
Browse latest Browse all 16232

Trending Articles