How to get the line number of a particular text

Hi guys,

I have a bunch of unstructured mail in which i want to know the line no. of a particular text in that mail.
Now the mail is in such a way that the text can only be extracted by Get OCR Text activity.

Now is there any way by which i can get the line no of that particular text in that mail with or without using the Get OCR Text. Well Get OCR text is the only way by which the text is getting extracted and no other activity is able to do so.

Here is just an example. In this pic i want to know the line number of the very first line i.e, the line “abc qwe wer cvb asd”. Remember that the line no that i am talking of is different for different mail and the rest of the lines are in the same structure for all the mails.

1 Like

If you use ZetExcel tools. You may get better solution. just try it for once. Thanks

Yah that’s absolutely possible
—once after getting mail list from any of the mail activity like for example GET OUTLOOK MAIL ACTIVITY named list_mails
-now use a FOR EACH activity and pass the above variable list_mail as input and change the type argument as System.Net.Mail.MailMessage
—and inside the loop use Another FOR EACH activity to get the line no of the text where mention the input as item.Body.ToString.Split(Environment.Newline.ToArray()) and change the type argument in the property as string and change the variable name from item to line
–inside this inner for each loop use IF condition like this
line.ToString.Contains(“your keyword”)
if this condition passes it will go to THEN part where we can use a writeline activity like this
"THE LINE NUMBER IS "+counter.ToString
where counter is a variable of type int32 with default value as 0 defined in the variable panel
–insde this THEN part next to this writelinee activity use a BREAK activity
–then next to this IF condition use a assign activity like this
counter = counter + 1

Cheers @diptojyotidutta

1 Like

hi @Frank_Miller can’t find the tools

I tried just as you said but it is not working. Here is the screenshot
image

1 Like

Here you go with a xaml
hope this would help you
mail.zip (9.9 KB)

Cheers @diptojyotidutta

Were we able to get them now
Kindly let know for any queries or clarification
Cheers @diptojyotidutta

it worked. thanks

1 Like

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