I am new to shell scripting, I am trying to get the days of week from csv column that has dates in format :
16/10/2015
19/06/2010
16/09/2013
4/7/2008
29/12/2017
I used date -%A and got the results converted but not to all and still getting error message with results :
date: invalid date ‘16/10/2015’
date: invalid date ‘19/06/2010’
date: invalid date ‘16/09/2013’
Monday
date: invalid date ‘29/12/2017’
Monday
Expected output:
Friday
Saturday
Monday
Wednesday
Friday
my code :
cat file.csv | awk -F "," 'NR>1 {print $4}' | awk -F, '{"date +%A -d\""$1 "\""| getline dte;$1=dte}1' OFS=","
I also tried to reformat the values into date type before converting to make sure but still getting the error message, I have a big file of data that's why I am trying to loop on the whole column in awk