Question

I am trying to write a table to a csv file, but the contents of each row are being stored in a single cell. I have tried using different row and column delimiters but nothing is working. Does anyone know how to fix this?

  • 31 August 2022
  • 5 replies
  • 586 views

imageimage


5 replies

Hello, I think you are missing enough information to be able to answer well, but I assume you are referring to the Data Table action: Write to file? If memory serves, that action sometimes does not work well for me also.

 

Depending on the volume/density of data you are working with you can do something like this, using Loop and Log to file action:

imageIn the first line I log my column headers to a csv file, separated by a comma. For this step make sure to select Overwrite file, if you want to make a new file each time this process runs.

 

Then I loop through the data table, for each row assigning that row to variable TableRow, and then accessing each column either through the header names (FirstName/LastName) within curly braces, or the column index (uses 0 based index) with square brackets. Then I write those vales to the csv file, again separated by a comma. For this step make sure to choose append to file.

 

imageLines 3 and 4 are not necessary, as you can use the TableRow{Value} directly in the Log to file action, but I wanted to illustrate the different ways to access the row data.

 

Hope this helps!

Thank you, I will give this a go

Userlevel 4
Badge +7

Hi @Liam O'Dowd​ ,

 

There is an Action called Data Table: Write to File which lets you write data to CSV in a single step.

imageCould you give this a try and let us know if it works out for you?

 

Kind Regards,

Ashwin A.K

 

Badge

Hi @Liam O'Dowd​ ,

 

There is an Action called Data Table: Write to File which lets you write data to CSV in a single step.

imageCould you give this a try and let us know if it works out for you?

 

Kind Regards,

Ashwin A.K

 

Hi Ashwin.
I’m having the same problem. The activity Data Table: Write to File does not separate columns and rows as it supposed to do. Do you have a fix or there is a bug?

Badge

Hello, 

I wanted to use Row delimiter : new line on DataTable write to file action but it still not working !! Any news about that ?

Waiting, I use coma as row delimiter, get text from file into which I write table and replace coma with stringNewLine variable as below : 

 

 

In my case I have 150 rows and only one column so it is relatively simple.

 

Hope this helps !

Reply