thanks for your reply.. I think my explanation might have given misunderstanding on the requirement.
let me explain again here.
I am getting the date string inside awk command as 2014-05-20
I need to get the week for this date.
assigning a global variable in awk is not giving me the correct week count for this date.
background:
> I am passing a csv file to this awk command. For each line there would be different date (it may not be the current date or same date).
> So using the date command or any in-build function of awk, i need to get the week for that date.
so can anyone kindly help on this... ???
Please let me know if you need any additional information.
Last edited by vijaidhas; 05-20-2014 at 05:22 AM..
You can use the mktime() and strftime() routines if your awk has them (gawk does). Here's a crude sample to give you an idea how it work. Check the "man gawk" page for more info
You can use the mktime() and strftime() routines if your awk has them (gawk does). Here's a crude sample to give you an idea how it work. Check the "man gawk" page for more info
Hi cnamejj,
Thanks for you help.
It helped a lot but still need a small help. I need to pass the year, month and date awk variable to mktime and get the week for that date.
the below code is always returning 1 if we are passing the variables in any case.
can you help on this.
Hi,
I am trying to add few (say 3 days) to sysdate using -
date -d '+ 3 days' +%y%m%d
and it works as expected.
But how to add few (say 3 days) to a literal date value and how bash treats a literal value as a date. Can we say just like in ORACLE TO_DATE that my given literal date value... (2 Replies)
how to find all files other than first two dates & last date per month and year
Hi All,
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt
-rwxr-xr-x 1 user userg ... (6 Replies)
Hi All,
what i want to do in perl is i should give the date at run time .Suppose date given is 23/12/2011(mm/dd/yyyy) the perl script shold find week start date, week end date, previous week start date,end date,next week start date, end date. In this case
week start date will be-:12/19/2011... (2 Replies)
Hi all,
I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date.
So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
How to find the Day of the Week of the given Date using perl?
If I have a date in YYY--MM-DD format, how to find the DOW? Based on that, I need to find the following sunday.
Pls help. (5 Replies)