Changing data format using sed and Xargs command
I have a file below. i want to change into below format.
bash-3.00$ cat test1.txt 37 "28/Jul/2013" 23 2121 0 37 "28/Jul/2013" 27 103463 0 37 "28/Jul/2013" 8 125667 0 Changing format: 37 "2013-07-28" 23 2121 0 37 "2013-07-28" 27 103463 0 37 "2013-07-28" 8 125667 0 Let me know the Command to use to change the format. Thanks, |
You show us what you did to solve this, and what you did to analyse any errors, and we might try and help.
|
Quote:
sed 's/\//-/g' test1.txt | xargs -0 date '+%F %T' -d |
why would you need to change the format, you could rather change the / with - and preserve the current format for date with just half line of code ?
hope this is not a Homework. :P Quote:
|
All times are GMT -5. The time now is 01:16 AM. |