Extra columns/commas in datatable after Build Data table activity

I am creating a data table to use throughout the workflow and it has 6 defined columns. When I run MyDataTable.Columns.Count.ToString() it returns 6 columns. However after the data table is created there is a string of commas following the columns. This is the datatable.

[Level,Time,Message,Hostname,Process,TransactionNumber
, , , , , ,
]

After rows are added and the table is saved as a CSV, opening it disturbs the format and does not display properly. How should I go about removing these commas as these columns are not needed.

How are you populating the datatable? Show your activities/code.

How are you writing the CSV? Show your activities/code.

Are you giving the file an extension of .csv? That’s required for Excel to know it’s a CSV and open it properly.

And that first row with just the commas is because you have a blank row. I’m guessing you didn’t delete the dummy first row of data when you configured the Build Data Table activity. You have to click the X to the left of it to remove it:

image

image

Thanks for the reply and the guidance!

Your guess was correct and there was an empty dummy row of data within the Build Data Table activity causing it to appear like trailing commas when they were just empty cells. Deleting that row fixed the issue!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.