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?



  • I don't think it's possible to understand your problem from your description.

    If I run the following with powershell 5 and linqpad 5:
    PS > "<Query Kind=`"Expression`" />`n`nnew[] { new {col1=`"a`",col2=`"b`"},new {col1=`"c`",col2=`"d`"}}" | sc test.linq
    PS > lprun -format=csv test.linq > test.csv
    PS > gc test.csv
    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.
  • Hi,

    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?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!