Page 1 of 1

Output to excel/csv file

Posted: 24 Aug 2011 09:13
by A_Bobby
Hi,

Trying to export output from different variables to different columns of Excel or csv file. Is that possible? Tried to look in the forum but could not find it.

e.g.

@echo %var1% %var2% %var3% >> whatever.xlsx

where the variable values of three variables should end up in A1, B1 and C1 cells.

Thanks,
Bobby

Re: Output to excel/csv file

Posted: 24 Aug 2011 10:56
by trebor68
With following code you will write the value to the csv file.

Code: Select all

@echo off
set dat=Test.csv
set vara=Anton
set varb=Berta
set varc=Caesar
echo "letter A","%vara%">%dat%
echo "letter B","%varb%">>%dat%
echo "letter C","%varc%">>%dat%
echo.>>%dat%
echo ,"three">>%dat%


"CSV" is comma seperated value
With the test batch can you save this row by row.

Re: Output to excel/csv file

Posted: 24 Aug 2011 12:45
by A_Bobby
Thanks! Even though it was not the output I had intended but it gave me the right direction