I have multiple comma separated files in a folder. Each CSV file looks like following:
"Column1","Date","Column2"
"fdfsd","20151023","rwer"
"fsdsf","20151023","jjfg"
.
.
I need to modify the 2nd Date column to display the date in this format "10/14/2015" or "2015-10-14".
Please can someone help me with this?
Thanks
This is what i have tried:
cat test.csv | while read line ; do echo $line\;$(date -d "%Y%m%d" "+ YYYY/MM/DD") ; done
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format] "Column1","Date","Column2";
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format] "fdfsd","20151023","rwer";
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format] "fsdsf","20151023","jjfg";
perlorawkorpython?