I am trying to execute multiple Powershell commands via a batch script, however I am having trouble writing the output into the same CSV. This data is being pulled via API and I eventually will use a Python program to insert the data from the CSV into a SQL database. The issue is that the API only allows for one single metric be to be pulled at a time, whereas I need to append all of these metrics into a single CSV. Below is a sample script of two different commands, both of which export into their own CSV. If anyone can provide me with a way to combine the output of these into a single CSV I would greatly appreciate it as I am completely stuck.
python get_samplemetric1_daily.py --pkgs samplemetric1 --country_code
samplecountry --date_from 2015-01-01 --date_to 2017-01-01 --format csv > MyFile1.csv
python get_samplemetric2_daily.py --pkgs samplemetric2 --country_code
samplecountry --date_from 2015-01-01 --date_to 2017-01-01 --format csv >> MyFile1.csv
When I attempt to insert the command -skip 1 in the context below, the error I receive is:
error: unrecognized arguments: select -skip 1
Below are the two ways I attempted to insert the select -skip 1 command:
python get_samplemetric2_daily.py select -skip 1 --pkgs samplemetric2 --country_code
samplecountry --date_from 2015-01-01 --date_to 2017-01-01 --format csv >> MyFile1.csv
and
python get_samplemetric2_daily.py --pkgs samplemetric2 --country_code
samplecountry --date_from 2015-01-01 --date_to 2017-01-01 --format csv select -skip 1 >> MyFile1.csv