LPRUN and Powershell and CSV!
I have this working fine in Powershell:
lprun -format=csv E:\Outbox\linq.linq > E:\Outbox\test.csv
The script runs a SQL query and dumps the output to a csv file.
When I open the csv file, though, all the data is in one column. How can I output the data so that it actually pus it into columns?
Thanks.
lprun -format=csv E:\Outbox\linq.linq > E:\Outbox\test.csv
The script runs a SQL query and dumps the output to a csv file.
When I open the csv file, though, all the data is in one column. How can I output the data so that it actually pus it into columns?
Thanks.
Comments
If I run the following with powershell 5 and linqpad 5: This is the the output I see: As you can see there are two columns here.
Can you describe exactly what you are doing, what you are expecting to see and what you are seeing. A minimal repro would also help, otherwise it's almost impossible to guess what you are omitting.
Thanks for the reply. My linq file contains one very simple piece of sql SQL: SELECT CA, CB, CC, CD FROM dbo.SomeTableWithData
When I run it in powershell (as in my first post), the data from all columns is in one column. Looking at your example makes me think I have omitted a step?
I had a similar problem. I wanted to process the result of my sql query in powershell.
This is how it works for me: Of course you can pipe it out to normal csv with
$linqresult | ConvertTo-Csv | Set-Content myFile.csv
I'd like to do it out of the box with lprune, but sadly I was not able to do it. The switches for format do not have any effect to my results. So maybe the powershell approach helps you.
Best regards,
Jochen
Of course you can pipe it out to normal csv with
$linqresult | ConvertTo-Csv | Set-Content myFile.csv
I'd like to do it out of the box with lprune, but sadly I was not able to do it. The switches for format do not have any effect to my results. So maybe the powershell approach helps you.
Best regards,
Jochen