finding lines with similar text

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

finding lines with similar text

Post by harryray2 »

Can I find lines that have similar and different text in.

eg:

As you will see the lines have a similar date in but different times....I would like to find these lines completely.

2018-05-28 00:10:37 @ user

2018-05-27 00:40:37 @ user

2018-05-26 01:10:37 @ user

I also want to use the regex for finding and replacing lines in a text editor.
NotNull
Posts: 5258
Joined: Wed May 24, 2017 9:22 pm

Re: finding lines with similar text

Post by NotNull »

Unfortunately, that's not possible with Everything. You can search for text - using the content: function - but only matching filenames will be listed.

I think you need a script to do what you want.
harryray2 wrote: Wed Feb 13, 2019 4:05 pm I also want to use the regex for finding and replacing lines in a text editor.
What do you mean by that? What text? What replacement?

P.S. On the to do list is a feature that will show the text highlighted in the preview pane.
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: finding lines with similar text

Post by harryray2 »

Not madly important for everything as I can find ways around it but I'm using emeditor and I was wondering what regex I could use on that for a search and replace...
NotNull
Posts: 5258
Joined: Wed May 24, 2017 9:22 pm

Re: finding lines with similar text

Post by NotNull »

Could you give a couple of examples of lines you want to be found and how they look after replacement?
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: finding lines with similar text

Post by harryray2 »

I keep a copy of everything I type, unfortunately the programme doesn't allow me to omit the time and date of when things are typed so I end with a lot of unwanted entries.

I want to be able to search for all these entries and delete them (replace with blank line.

So, for example, I want to delete these entries and just end up with blank lines so that I can then run a "remove blank line" option.

2018-05-28 00:10:37 @ user

2018-05-27 00:40:37 @ user

2018-05-26 01:10:37 @ user
NotNull
Posts: 5258
Joined: Wed May 24, 2017 9:22 pm

Re: finding lines with similar text

Post by NotNull »

Don't know about emeditor specific, but generally that would be something like:
Search for:
^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s@\suser$\n

Replace with:
(nothing)

Some explanation:
^ = start of line
\d{4} = 4 digits (0-9)
\s = a space
$ = end of line
\n = "Enter" / go to new line. That way you don't have to remove the empty lines manually. Maybe emeditor wants \r\n instead of \n.

Let us know if this works (test it on a copy of your file to prevent data loss)
Post Reply