0

I found a sort-of answer here:

https://superuser.com/questions/730249/run-command-to-open-csv-file-in-excel

But it's not enough to simply use excel to open my .CSV file; I want to import the .csv data into the excel worksheet (I can do it using the wizard built into excel if I open the program manually), but I want to do this all strictly using CMD. I have previously generated a .csv file using SQLCMD but I couldn't generate it into an excel file, so I'm trying to do this all in 2 steps instead.

PBJ
  • 354
  • 2
  • 15
  • maybe [this](https://superuser.com/a/1222081/217811) is helpful? – Stephan Mar 21 '19 at 16:40
  • @Stephan thanks - it's not quite the solution I'm looking for, but there is some useful information in there. I could always try new approaches again. – PBJ Mar 21 '19 at 18:12
  • 1
    With PowerShell and the [ImportExcel](https://www.powershellgallery.com/packages/ImportExcel/5.4.0) module (even without excel installed) you could possibly have it in a single step - at a learning curve of course. –  Mar 21 '19 at 20:23
  • @LotPings I will definitely look into this. Thank you! – PBJ Mar 22 '19 at 12:13

1 Answers1

1

I found a powershell version of what I need here: How to export a CSV to Excel using Powershell.

I made my own adjustments to fit my needs, but it worked perfectly! And I learned how to call this powershell script from my cmd/batch file so I think this will work.

PBJ
  • 354
  • 2
  • 15