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 ZealandPosts: 9306 |
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 ZealandPosts: 9306 |
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 KingdomPosts: 858 |
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 KingdomPosts: 6786 |
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: GermanyPosts: 76 |
Tanks Very helpful hint. Works like the *nix command grep. Gregor |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9306 |
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: AustraliaPosts: 1101 |
@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 ZealandPosts: 9306 |
Smoke makes things work. When the smoke gets out, it stops! |
||||
Print this page |