String Manipulation- split and replace

In word document,i have a table which has 5 columns and 3 rows.I have extracted text into string format.
I need to get the 3rd column value as output.

For each cell separation,hyphen is coming by default.
So i have taken hyphen as delimiter to split but now i got a problem that column 3 or column4 sometimes has hyphens.because of hyphen in column3,value is column 3 is splitting

@ppr @Palaniyappan @lakshman @supermanPunch

Hi @Satish_Ch

Please Share the Output you are getting and what is expected?

Loveleet Saini

I am getting arr(2) = FCB as output but actual should be all the value in column 3.

I am splitting each row with hyphen as i dont have any other option because of hyphen coming after each cell.
Ex : 1 - 100% - FCB- Sure post Parcel select…

Like above

How are you reading the table?
It would be easy if it is in excel

We are extracting everything as text.
Table rows are coming as rows…like we can use for each row and row looks like below after we are in for each loop

1-100% - FCB-Surepost is a machine - Dog has its day - 5

For getting value from column 3, Use
row(“column name”).tostring
Inside for loop.

Please share the sample file if possible so that I can work around.

Not possible to share sample.but i have already attached the screenshot of the same.

@vvaidya could you help me here.
I tried the solution provided by you in forum for same kind of query.

When we read word doc text into notepad it will come as like below screenshots.
Its coming with hyphen to separate each cell.
So i need to replace that hyphen which is separating cells with some other.because in cell values sometime we might get hyphen in middle sentence .so i cant use hyphen as delimiter while splitting.

Before splitting either i need to change hyphen in cell or separator.

Please help me to resolve @vvaidya

Hi @Satish_Ch ,

Will the template of the word file be always fixed ?

Meaning will there always be a table at that occurence, For Example, This is the 3rd Table in the document, will it always be the third table in every other similar sample of documents or does it vary ?

Or in Other words, How we identify that it is the table to be extracted ?

Yes table will be at same place

@Satish_Ch ,

In that case, Could you check the workflow below : (13.6 KB)

It uses OpenXml methods to get the tables present in the document using Invoke Code Activity. Firstly Preparing the columns and then preparing the row values and adding it to datatable, generating list of datatables which is a dataset.

Let us know if you are still facing difficulties.

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