Extract specific data from notpad++

Is there a way to read (extract) specific data from the search results in notepad++ ?
If I use check app state ot get text activities its take the all area in the search result.
I know there is a way in XML to read text file but is there a way with notepad++ ?

Hi @mironb,

One approach to extracting data from a notepad file would involve utilizing the “Read text file” activity in conjunction with regular expressions (Regex). It would be helpful to clarify which particular data elements are to be extracted from the file in question.

Can you please provide additional information regarding the file’s content and the specific data that needs to be extracted

Regards,
Darshan

Hi @mironb what is the extension of this file? is it .txt. In that case, you can read the data with Read Text File activity

Its not a saved file.
I am open the notepad++ and search->find…->find in files->find what (paste a number)-> and pressing find all button
then I am getting the search results

Its not a saved file.
I am open the notepad++ and search->find…->find in files->find what (paste a number)-> and pressing find all button
then I am getting the search results

Use Get Text activity to extract the data. Check attached workflow for reference

SampleProcess.zip (4.4 KB)

@mironb

You can actually read xml file also as text using read text file and then use contains method to know if there is a value

St.Contains("abc")

Cheers

@Anil_G But its a search on notepad++

@mironb

On notepad++ you are trying to open reference a file and then search for some value in that file …am I correct? Or is there somethign else that you are trying to acheive…

Cheers

@Anil_G
Its not a saved file.
I am open the notepad++ and search->find…->find in files->find what (paste a number)-> and pressing find all button
then I am getting the search results


I AM TRYING TO PULL DATA FROM HERE

@mironb

I guess then you cannot extract separately but can try using regex to expract only the line values

System.Text.RegularExpressions.Regex.Matches(ExtractedText,"(?<=Line).*")

You can loop through this …its an ienum of match …which can be accessed in the loop and then can get each matched line

Extractedtext is the text extracted from whole search result

Cheers

@Anil_G
How to implement that ?

@mironb

Use the expression in a assign activity or you can copy the regex inside it

(?<=Line).* And use it in matches activity…the output can be looped using for loop

Cheers

Hi @mironb ,

The method of finding the number in a manual way using the Search Option can be also done in the Background method of Reading the File and getting the data as a String data and performing the search within it.

Just let us know what is the end output required. After Finding the number what do you want to do with it ?

@supermanPunch
I got this result

Then I need to verify the customerID

@mironb ,

For your case, could you just try with the below Steps at first, then let us know if it works. We might need to know how you are actually doing the verification of the ID.

  1. Use Read Text File Activity with the file path of thetext file that you want to search/find the number. Assign an output variable to this activity, say the variable name be textData.

  2. Next, For Checking if the Number exists in the text file or text data, we can use the below expression in an If Activity. We can assign the number to a variable (Just for dynamical purposes)
    Using an Assign Activity :

yourNumber = "500054627"

Here, yourNumber is a variable which contains the number you want to search in the text data.

In the If Activity :

textData.Contains(yourNumber)

The Expression above results in true, if the number is present in the text data.

You can then perform the verification part.

Do note that your complete requirement is not yet exposed. Do let us know more details in order for us to help you provide correct suggestions.

We also see that the data is in the form of Xml Structure, Parsing it to an Xml could also make the task, but again we would need to know your complete requirement that you are trying to achieve.

@supermanPunch
Thanks, but I am not using saving file, I making a search
I am open the notepad++ and search->find…->find in files->find what (paste a number)-> and pressing find all button
then I am getting the search results

@mironb ,

May we ask you why this is not performed, or where exactly the data is stored ? Is it not stored in a Text file ?

Are you transferring the data from some other application or portal to Notepad++ ?

We need to understand the where is the data source coming from ?

The reason we are trying to conclude these is because we have a better efficiency if we take up a Background method of Automating the task than performing using UI methods.

@supermanPunch
The Data is sorted in the network some folder - I pull it from there Using CustomerID number
Then I need to see in the search result that the XML created