Now I need to find the difference between these 2 dates...for eg if I subtract date1=13/07/2013 23:55:55 and date2=14/07/2013 23:55:55..then the difference in minutes between these two dates is 1440..now I need to divide this number with the first field of the file.So the difference=date2-date1/60
I need to perform this operation for too many files.but the calculation is taking too much time.I am working on AIX. there is no mktime function available.How to optimize it.....
In message #1 in this thread, you show a comma separated file with dates in day/month/year format. (And you have "t60" as a sample dividend.)
In message #3 in this thread, you show a space separated file with dates in year-month-day format.
Are these two different problems mixed into one thread? Is the program you want created for you supposed to handle both input formats? Are there other input formats?
Your use of 365.25 and 30.5 inside $((...)) imply that sh on your system is a 1993 or later version of the Korn shell. Assuming that is correct and that the calculations in the script you showed in message #3 are accurate enough for what you're trying to do, that script can be made MUCH faster by letting the shell perform the field splitting instead of using so many invocations of cut. Try replacing: