Append data to new row in CSV file every day

Hi All

I will run the same script every day in corn and output should go to same CSV file but in different row with dates on it. Below is my example in attached format.

Script i am using to collect switch port online

DATE=`date '+%d-%m-%y'`
for f in `cat /home/user/switch-ip/switch-ip-test.txt`
do
     echo $f-[$DATE] >> /home/user/switch-ip/switch-nolight.csv
     plink -ssh -v chrrbs@$f -pw secure01 switchshow |grep "No_Light" >> /home/user/switch-ip/switch-nolight.csv
done

So... what is the problem? What does it do right now?

Without seeing the input data, we cannot possibly help you. What does plink here output (before grep)? And why are you grepping for No_Light?

Also, please read Useless Use of Backticks before your own bugs come back to haunt you.