Find matches activity - Result property

Hello guys,

I need to extract some data from a file and enter on Excel file. Here I’ve used Regex expression.


Here I’ll take the name, MBR, ACNT & ICN. For first one it’s okay… How I can take these things if the file contains two or more like this

how can I extract these things properly?

Thanks.

@Venkatraj_WaMDS

Use Find Matching Patteren Activity to extract Name ,This will be IEnumerable of Match Means Collection Take For Loop And then write these values in Excel.
Do the Process As it is for Other MBR,ACNT,ICN and Write the results in Excel
Hope this helps you

Hi @Venkatraj_WaMDS

As you said it will applicable for the first row only. If your data is not confidential then share you data with us. we will provide the regular expression to extract the required data.

Send the output excel sheet to know how result looks.

Hi @mkankatala

Thanks for replying.


This is how the result file looks.

share you text file with us which have the the data then we will give the regular expressions… @Venkatraj_WaMDS

It’s not a text file sir it’s kinda invoice. And unfortunately I can’t share the file because it’s confidential. But there is no problem with Regex expression. I’ve created a Regex pattern correctly. Problem is only with extracting the second data to excel.

Hi @rlgandu

Thanks for your reply.

In this how can I match all the values correctly in excel? It will write all names first and then second MBR down and other values down right?

@Venkatraj_WaMDS

You have to check them Manually whether it writes the data correct or not.if not you have change the regular expression for that field

Hi @rlgandu

Nothing problem with Regex. Process is…

  1. Find match patterns - to extract a name. Here I can take first match as output property and to find second match we use Result option right? IEnumerable.Matches. Now I need to get every name in this sheet.
  2. So I used for each there Var1= item.Value gives me every name. This is okay.

Now how can I do this for all columns… If i add this in excel. Other columns will enter down…

Help me to get solution @Anil_G @Sudharsan_Ka @ashokkarale and others

@Venkatraj_WaMDS


This for name you have to do this for other columns for “MBR” take “B” .So that you are able to write all the columns data

@rlgandu

But if we do this… When we run next time the previous data will erased and new data will be entered right?

@Venkatraj_WaMDS

Yes you are correct

Then I can’t use this way bro… Because I can’t erase the previous data…
New data should be appended. Is there any other way to do this?

@Venkatraj_WaMDS

I think You have multiple pdf so that you can create a excel file based on the name of the Pdf name:

Path.GetFileNameWithoutExtension(FileName)+".xlsx"

Then You have to create one Destination File which contains all data
“DestinationExcel.Xlsx”
Then you append “Path.GetFileNameWithoutExtension(FileName)+”.xlsx"" that data to the final “DestinationExcel.Xlsx”
So that whatever pdf data you have after writing all columns data then you append that data to one final excel
Hope it will help you

No sir. Actually this is out of context! If file extention is the problem how can I get the first data from all the files perfectly?

The problem is with IEnumerable and the mulitple data from same file.

@Venkatraj_WaMDS
Can you be more specific,i don’t get your point

Process is to get Name, MBR, Acnt and ICN from a file.
image

Some times the file contains 2 or more name, MBR, Acnt and ICN…
When we using Find matching pattern activity with the help of IEnumerable matches we can get second match. how can we take every second matches and other matches? and enter in excel like this


Hope you understand now.