Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:29 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Help with Notepad++ please....

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 11:24pm 26 Feb 2024
Copy link to clipboard 
Print this post

I'm trying to use Notepad++ to search a large text file, for a keyword.
I've worked out how to do that, but I can't work out how to COPY all those results either to another file, or to the clipboard so I can paste it into another application.

I ONLY want the lines in the text file, with that keyword in it, and I want to totally ignore all the other lines.

I can get Notepad++ to show me what I want on the screen using SEARCH/Incremental Search, and then put my keyword in the FIND box.

I end up with 1,703 matches - how do I copy those matches and ONLY those matches to another file or the clipboard?

If I try the obvious, and right-click/copy, it only copies that one line the mouse was on.  If I try CTRL-A, it just copies the entire file as you might expect.

I want to copy ONLY the results of the search.  Does anyone know how to do that?
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 11:36pm 26 Feb 2024
Copy link to clipboard 
Print this post

Nevermind - worked it out.  

EDIT: SEARCH/FIND..., type in my keyword, click FIND ALL IN CURRENT DOCUMENT.  A small window opens up with all the results, CTRL-A select all, right-click/COPY - done.
Edited 2024-02-27 09:38 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 858
Posted: 11:37pm 26 Feb 2024
Copy link to clipboard 
Print this post

I was just about to hit the sack so I'm not sure if this is what you need.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6786
Posted: 08:27am 27 Feb 2024
Copy link to clipboard 
Print this post

Ah, Notepad++ - the vi of the Windows world. :)

(well, maybe not that bad...)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
aFox
Regular Member

Joined: 28/02/2023
Location: Germany
Posts: 76
Posted: 12:37pm 27 Feb 2024
Copy link to clipboard 
Print this post

  Grogster said  Nevermind - worked it out.  

EDIT: SEARCH/FIND..., type in my keyword, click FIND ALL IN CURRENT DOCUMENT.  A small window opens up with all the results, CTRL-A select all, right-click/COPY - done.


Tanks

Very helpful hint. Works like the *nix command grep.

Gregor
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 10:23pm 28 Feb 2024
Copy link to clipboard 
Print this post

I used grepwin last time and I still had it on my machine, but I could not remember how to make it give me the results in a separate file either!

I tried NP++, cos I remember someone saying that it could do that job also.
All just a matter of working out how to drive software X!  
Smoke makes things work. When the smoke gets out, it stops!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 12:33am 29 Feb 2024
Copy link to clipboard 
Print this post

@Grogster

You could do it simply from a terminal on your mint system like so

cat 'your_file_to_be_scanned' | grep 'search_string' | tee result.txt

This will print all lines from the source file that contain the search string to the terminal screen and to a file called result.txt

It will overwrite anything already in result.txt unless you add -a after the tee command.
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 01:59am 29 Feb 2024
Copy link to clipboard 
Print this post


Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024