How to add datarow into a datatable from a textfile having data in Pipe delimited format

Hi All,

This is a great forum. Thanks to all for making this forum much interesting. I’ve got answer’s to most of the queries through this forum.

Jumping to the problem statement: Need to build a data table using the below data part of the text file
Sam|kumar|2018|23|asdnsfns.txt|
Santos|kumar|2018|43|asdnsfns.txt|
Johnny|kumar|2018|43|asdnsfns.txt

I was able to split the string. However, the hurdle part is adding the datarow to the datatable. Any kind assistance is appreciated. Also, have attached the xaml for the reference.Thanks

TextDataRow.xaml (11.4 KB)

Hey @Ilangos,

Is the piped seperations constant for all?
That is, will there be 5 strings in each array when seperated?

Hi Rishabh,

Yup, the pipe separation would be constant for all.

If you want only FirstName and LastName, then you can replace your for each with Add DataRow.
Check this workflow.
TextDataRow.xaml (10.0 KB)

Hey @Ilangos
Delete the inner for each loop and try to put only the add data row activity instead.
Refer to the screenshot below:

PS- If you want only the first and last name only put {splititem(0),splititem(1)}

Hi Bharat/Rishabh,

Thanks a ton… It worked !!!. You guyz rock :slight_smile:

1 Like