I need an awk script for the problem illustrated below.
My input file will look like this,
560,2/20/1998,aq
560,2/24/1998,bq
560,2/27/1998,aw
560,2/28/1998,qwe
560,3/4/1998,iop
560,3/6/1998,pai
My required output is,
560,2/20/1998,aq
560,2/21/1998,aq
560,2/22/1998,aq
560,2/23/1998,aq
560,2/24/1998,bq
560,2/25/1998,bq
560,2/26/1998,bq
560,2/27/1998,aw
560,2/28/1998,qwe
560,3/1/1998,qwe
560,3/2/1998,qwe
560,3/3/1998,qwe
560,3/4/1998,iop
560,3/5/1998,iop
560,3/6/1998,pai
Note:
1) There are exactly three fields in all input records.
2) Dates will ALWAYS be in sorted order as given in this example.
3) Manipulation is necessary only on the second field(Date) to arrive at the final data. Any other pattern you might observe in first or third fields of this example is purely unintentional.
Thanks in advance.
My input file will look like this,
560,2/20/1998,aq
560,2/24/1998,bq
560,2/27/1998,aw
560,2/28/1998,qwe
560,3/4/1998,iop
560,3/6/1998,pai
My required output is,
560,2/20/1998,aq
560,2/21/1998,aq
560,2/22/1998,aq
560,2/23/1998,aq
560,2/24/1998,bq
560,2/25/1998,bq
560,2/26/1998,bq
560,2/27/1998,aw
560,2/28/1998,qwe
560,3/1/1998,qwe
560,3/2/1998,qwe
560,3/3/1998,qwe
560,3/4/1998,iop
560,3/5/1998,iop
560,3/6/1998,pai
Note:
1) There are exactly three fields in all input records.
2) Dates will ALWAYS be in sorted order as given in this example.
3) Manipulation is necessary only on the second field(Date) to arrive at the final data. Any other pattern you might observe in first or third fields of this example is purely unintentional.
Thanks in advance.