Add columns and convert text to column delimited by space in excel

Hi All, How can I add two new columns between the “File” column and the “Date” column and distribute the data from the “File” column

image

Example of the result:
image

Help me please!

1 Like

@aferreira054

Please check below thread.

How to insert new column in excel sheet - #5 by Ananthaeswar2

Hi
no worries
Hope these steps could help you resolve this

–yah we can create new columns inbetween where we need using SETORDINAL method using invoke method
kindly have a view on this thread on how to create a new column in between the existing one

–once after creating two columns like what we need now its time segregate the value from File column
–hope you would have read the table from excel with read range activity and the output variable datatable named as outdt
–now use a for each row loop and pass the outdt variable as input
–inside the loop use three assign activity like this
row(0) = Split(row(0).ToString," ")(0).ToString.Trim
row(1) = Split(row(0).ToString," ")(1).ToString.Trim
row(2) = Split(row(0).ToString," ")(2).ToString.Trim

this will segregate the value to each columns

hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @aferreira054

1 Like

Thank you.
I have a problem, it does not save any data in row(1) = Split(row(0).ToString," “)(1).ToString.Trim
and row(2) = Split(row(0).ToString,” ")(2).ToString.Trim.
Can you help me with that please!

1 Like

Does that column has any value in it
Kind check that once and let know buddy
Cheers @aferreira054

1 Like

This is my syntax, maybe I am wrong on something, can you check please.

InsertColumn.zip (8.6 KB)

1 Like

I m not with my system
If possible kindly share the screenshots of the workflow
Cheers @aferreira054

This is my excel file
image

image
image
image
row(0) = Split(row(0).ToString," “)(0).ToString.Trim
row(1) = Split(row(0).ToString,” “)(1).ToString.Trim
row(2) = Split(row(0).ToString,” ")(2).ToString.Trim
image

After executing it gives me this result
image

does not insert the data in the two columns that I added.

1 Like

Fine
Before this three assign activities use one more assign activity
Like
Out_text = row(0).Tostring
Where Out_text is a string variable
— is use that string in split method
Like this with assign activity
row(0) = Split(Out_text.ToString," ")(0).ToString.Trim
row(1) = Split(Out_text.ToString," ")(1).ToString.Trim
row(2) = Split(Out_text.ToString," ")(2).ToString.Trim

This will work for sure
Kindly try this and let know for any queries or clarification
Cheers @aferreira054

1 Like

Thank you!

1 Like

No Worries
Cheers @aferreira054

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