I have data separated by a comma saved in a word and I want to read it to separate it into an excel table
Hello,
Could you give us a bit more details like each comma seperated values should be different rows or columns?
If each value should be different rows, do the following:
- Read the word file and store in a string.
- Create a datatable to store the data.
- Use a for each and loop through this: Split(WordText,“,”). The type argument should be string.
- Inside for each loop, use Add DataRow activity and add the item.
- After for each loop, write the datatable to the desired excel file.
Hope this helps!
Thanks
Athira
how to read the word file? using word application scope??
Hi
Give a try with word package
Go to design tab → manage packages → all packages-> search as UiPath.Word package and install it
Cheers @Diana_Garcia1 @guptasweb
Hello,
Have you created a datatable before trying to add the row ?
Thanks!
Did you create DataTable before adding data to it using Add Data Row activity ?
If not then use Build DataTable activity to create new DataTable named dtInput with all the required columns and then add data to it using Add DataRow activity.
Please pass the variable “Empty_DT” and run again, as your datatable name is Empty_DT.
Also, I can see that you are looping through a string- not an array. Can you please explain what you are trying to achieve? And if possible, please provide the sample word data you are using. You can create a new thread for these questions.
Thanks!
Athira
i have created so many times but no one reply there
Hi @Diana_Garcia1 ,
Could you provide us with a Sample of your Data to understand the format of the Data to Extract?
Most probably, we would require to use String Manipulations/Regex to achieve your desired Output as you have mentioned the Data is Separated by Comma’s.