Splitting 2 or more words into different cells in Excel

Good Day.

I am trying to split 2 or more words into different cells in Excel.

image

The desired output is this:

image

Thank you.

Hi @RobertRussell_Monsalud

Check with the below linq query:

dt = dt.AsEnumerable().Select(Function(row) dt.Clone.LoadDataRow( { row("TextColumn"), Split(row("TextColumn").ToString(), " "c).ElementAtOrDefault(0), Split(row("TextColumn").ToString(), " "c).ElementAtOrDefault(1), Split(row("TextColumn").ToString(), " "c).ElementAtOrDefault(2) }, False)).CopyToDataTable()

Regards

Hi @RobertRussell_Monsalud

Word -->Array of String datatype

words=CurrentRow(0).ToString.Split(" "c)

Output
image

Hope it helps!!

Hi @RobertRussell_Monsalud

Use Generate Data Table From Text activity

Output:

Sequence3.xaml (7.7 KB)

Regards,

1 Like

May I know what would be the solution as I am having this kind of error?

Book1.xlsx (8.8 KB)

Hi @RobertRussell_Monsalud

Please check the below flow:

Workbook:
Book1.xlsx (9.5 KB)

Xaml:
Sequence23.xaml (10.0 KB)

Regards

Hi @vrdabberu

I tried to check it but the output is this

Hi @RobertRussell_Monsalud

Please check the excel I have attached and also try the xaml I have attached.

Remove the add header’s option in the write range workbook activity and also please check the data table variable you have passed into the write range activity.

Regards

Hi @vrdabberu

I unchecked the add header’s option but the result is still the same.

Hi @RobertRussell_Monsalud

Can you share your workflow?

Regards

Hi @vrdabberu

Actually I’m using your workflow but I don’t know why it is not working in my end. Do I need to add an activity?

Sequence23.xaml (10.0 KB)
Book1.xlsx (8.7 KB)

Thank you.

Best regards,
Robert

Hi @RobertRussell_Monsalud

Please change this options in the generate data table activity and give a try:

Regards

1 Like

Hi @vrdabberu it works! Thank you so much

1 Like

You’re welcome @RobertRussell_Monsalud

Happy Automation !!

1 Like

Hi @vrdabberu

May I know if I still need to use LINQ? Thank you.

Best regards,
Robert

No need of LINQ @RobertRussell_Monsalud

Regards

1 Like

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