add query results in a csv in linux
by mierdatuti from LinuxQuestions.org on (#4ZNRT)
I have a query in shell scripts that gives me a results like:
Code:article;20200120
fruit;22
fish;23I execute that report every day. I would like that when I execute the query the next day shows me output like that:
Code:article;20200120;20200121
fruit;22;11
fish;23;12These report I execute with postgre sql in a linux shell script. The output of csv is generated redirecting the ouput with ">>" Please any help to achive that.
Thanks


Code:article;20200120
fruit;22
fish;23I execute that report every day. I would like that when I execute the query the next day shows me output like that:
Code:article;20200120;20200121
fruit;22;11
fish;23;12These report I execute with postgre sql in a linux shell script. The output of csv is generated redirecting the ouput with ">>" Please any help to achive that.
Thanks