How do I display text with multiple line in a DataTable and write to a excel file?

I used ‘Generate DataTable from Text’, but the data doesn’t display correctly (see image). How can I display text with multiple line and write it to a excel file ?

Hi,

Can you also share expected output?

If you can ignore linebreak in each data, it may be better to remove it in advance.

strInput.Replace(vbCr,"").Replace(vbLf,"")

Regards,

1 Like

expected output

image

Hi,

Unfortunately, it seems GenerateDataTable always recognizes new line character as NewLine-separator even if other character is set.

To avoid this, how about the following sample?

Sample

Sample20250424-2.zip (9.7 KB)

Regards,

at 2nd assign act, why you do that ?

Hi,

As I mentioned in my previous post, GenerateDataTable handles new line character as NewLine-separator even if other character is set as NewLine-separator.
To avoid this, the Assign activity converts it like CSV style format.
In csv format, data contains new line character should be enclosed double quote character. So, the assign acitivty add double quote character to be enclosed all the data and convert pipe to new line character to be able to handle it by CSV parse mode.

Hope this helps you.

Regards,

Will I get the same output if I change the delimiter for columns and rows in the input string?

Basically yes, unless uses special character of CSV like double quote, I think.

1 Like

@Anonymous_iL

below is the text which you have mentioned
image

I have replaced newline with a space (" ")
image

In below you can see generate data table activity will consider colon as column separator and | as row separator