Date conversion DD-MMM-YY to YYYYMMDD for many columns in a file
Hi,
Input
Output
I want to convert the date format for col2,col3,col21.Tried with below command for one column 4 but i am unable to disply the value same position.
Thanks
Suri
Last edited by jim mcnamara; 01-14-2016 at 09:05 PM..
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi,
Date utility collection dateutils, can handle situations like this. Here's a demonstration, but note that this version of dconv will fail on some 2-digit year data. This is an issue with Debian being behind, the author has added an option to handle many 2-digit years correctly.
producing:
I hesitated to post code that doesn't work correctly with the user data, but the usefulness of the dateutils collection is appropriate, especially because the issue can be resolved with a more recent version than I have at my disposal.
My requirement is:- there will be files at a location each day with the date format DDMMYYYY.
Novawise_Activity_Call_Notes_04022013.txt
Novawise_Activity_Inbound_04022013.txt
Novawise_Activity_Inbound_05022013.txt
Novawise_Activity_Call_Notes_05022013.txt... (8 Replies)
I have the following perl one-liner to get yesterday's date, but I would like it in the form of dd-MMM-yy (for example: 01-JAN-12). Can someone alter the below code so I get the format I want? Also, could someone also give me a line for dd-Mmm-yy (for example 01-Jan-12)?
Code:
YEST=`perl -w... (3 Replies)
Hi All,
We are copying all the files into ARCHIVE directory after we process them. We are doing this process from last 2 years, now we have a lot of files in ARCHIVE directory.
Now I need to find when the first file is copied into this directory?
If I Issue,
ls -l /ARCHIVE/*.* | tail -1... (3 Replies)
Hi,
I have a log file that contains information along the lines of the following:
=========
jobnumber 322761
start_time Tue May 19 19:42:37 2009
end_time Tue May 19 20:11:28 2009
failed 0
=========
jobnumber 322762
start_time Tue May 19 19:39:51 2009
end_time ... (4 Replies)
I have a file with some date columns in MM/DD/YYYY format:
SMPBR|DUP-DO NOT USE|NEW YORK||16105|BA5270715|6/6/2007 |MWERNER|109||||JOHN||SMITH|MD|72211118||||||74559|21 WILMINGTON RD||D|11/6/2003|SL# MD CONTACT-LIZ RICHARDS|||0|Y|N||1411458|
And I want to convert the date format to:
... (5 Replies)
Hi
i need to convert a date in the format DD-Mon-YY to YYYYDDMM
Ex : 01-JUL-00 to 20000701
Can anybdy help me with this??
Thanks in advance
Shenaz (5 Replies)
I would like to know how I could get a yesterday date in yyyymmdd e.g. today is 20011109, and I would like to get 20011108. Thank you!:confused: (2 Replies)