Vani11
October 2, 2018, 5:36pm
1
Hi,
The have the below data in one cell in excel
Employee number: 12345
Employee name: Name
Phone Number: 1234567890
Job Role: Trainee
Start date: 15-10-2018
I want the data to be split to various columns with their values below them.
|Employee number |Employee name | Phone Number |Job Role |Start date|
|12345 | Name |1234567890 | Trainee | 15-10-2018|
Can anyone help me out?
Thanks in advance
Hi @Vani11 ,
You can read the data from excel and then split them into different variable, once you have the values you can build datatable and insert values in the table by AddDataRow
See this sample -
Main.xaml (12.9 KB)
Test.xlsx (8.9 KB)
result.xlsx (8.4 KB)
You can modify this sample according to need
Thanks,
Prankur
1 Like
Vani11
October 3, 2018, 7:46am
3
Thank you so much for your reply.
The xaml file says ‘Could not find member ‘CurrentIndex’ in type ‘http://schemas.uipath.com/workflow/activities:ForEachRow ’. Row: 102, Column: 20’ .
Please advise
Are you using the latest version? Reinstall package might fix this
Vani11
October 3, 2018, 7:49am
5
Yes. I’m using the latest version. Can you tell me which package to reinstall?
Any activity which you are not able to see? Or are getting this error when you run the program
Can you attach a screenshot
UiPath.Core.Activities is the package. Also is that does not work do this
Vani11
October 3, 2018, 7:57am
9
Thank you @PrankurJoshi . When I tried to update the UiPath.Core.Activities package I get the below error
Restart the studio and try again
Vani11
October 3, 2018, 8:01am
11
No Luck Anyways I will try the solution you have provided and will get back to you.
Thanks once again
Vani11
October 3, 2018, 8:16am
12
Thank you so much @PrankurJoshi . Your solution for splitting the cell data to various columns worked.
1 Like
MAHESH1
(MAHESHKUMAR JV)
October 3, 2018, 8:19am
13
@Vani11
Read the Cell and and save in a string let us take as strValue
Array Values= (From p In (strValue.Split({Environment.NewLine},StringSplitOptions.None)
Select Convert.ToString((p.Split({":"},StringSplitOptions.None)(1))).ToArray
Now Use Add DataRow Activity and pass the variable Array Values.
Regards,
Mahesh
1 Like
Vani11
October 3, 2018, 8:25am
14
Hi @MAHESH1 Let me try your solution as well and get back to you
Thank you for your response
MAHESH1
(MAHESHKUMAR JV)
October 3, 2018, 8:26am
15
@Vani11
You can do by using simple Regex
Use Matches Activity and pass this pattern (?<=:). * input string should be the value you extracted from cell.
After that convert the collection to the array of strings and pass it to AddDataRow Activity.
Regards,
Mahesh
1 Like
Vani11
October 3, 2018, 11:45am
19
Thank you @MAHESH1 . Your solution worked as well.
Thank you @PrankurJoshi and @MAHESH1 for your response
2 Likes