Please help - Get data from multiple word documents and put into one excel column

Hi all,

I have about 500 different word documents, where a specific country is given like this:
image

It is only the last value - Poland (their country that i need to transfer to a excel coloum).

Do any of you guys know how to make such a request? - How to take about hundreds of different countries from hundreds of different word documents, and put into one excel sheet in a column, so it looks like this:
image

I really hope some of you knows how to do this, it would really be a big help!:slight_smile:

Hi @Emilia_Malmberg_DK ,

Welcome to the community.

Use read text acitivity(which is in UiPath.Word.Activities package ), which gives you word document text into a string variable.
Now split this string variable by each line,
loop through each line and if line starts with - place of birth: , then use string manipulation functions like substring and extract the country name
Now you put this country name into your excel sheet.

Hope this helps.

1 Like

Hi @Emilia_Malmberg_DK
another way is to use regex to extract the data , attaching a sample workflow
sample.xaml (10.4 KB)

Regards,

Nived N
Happy Automation

1 Like

A full StudioX solution could look like this:

  1. For each file in type in the folder with the docx extension, Open in Word and Read the contents as text:
    image

  2. Isolate the text between "place of birth: " and End of Line (this is vbCr in Word, you will have to use AdvancedEditor to insert this value)

  1. You can use InputDialog to check the value before inserting it in Excel usin WriteCell. Do not forget to check “Auto increment row”.

Here are the Word files:


image

1 Like

Thank you so much!!!