Page 1 of 1

Search Results for single file

Posted: Mon Sep 17, 2012 1:27 pm
by NaasDup
Hi

Is there a way to capture the results of a search in a single file to the search results window? I search large files for certain strings and would like the line(s) where the string was found to be stored/copied to the search results window like when you do a search in multiple files.

Thanks

Posted: Mon Sep 17, 2012 1:51 pm
by ak47wong
Not in the normal Find dialog, but as a slightly-cumbersome workaround you can use the Find In Files command to search a single file. You need to put the file name and folder path in the In files and In folder fields respectively. If your file name contains spaces you need to enclose it in quotes. Clicking Defaults sets the In folder field to the current working folder.

Posted: Mon Sep 17, 2012 7:07 pm
by NaasDup
Hi

That is what I am doing at the moment but not what I want.

See I do not want the file name/path prefixed to each returned line in the results. I just want the line number and actual data.

Use bookmarks

Posted: Thu Oct 18, 2012 4:13 pm
by Jim4Prez
In the find dialog you can click "Mark All". This will bookmark the line(s) that match. Next you go to Edit -> Copy Other -> Bookedmarked Lines.
Now press CTRL+N for a new tab then CTRL+V to paste.

I created a keyboard shortcut to copy the bookmarked lines. In preferences -> keyboard select category Edit and command EditCopyTaggedLines and assign a key to it.

I'll vote for you!

Posted: Thu Oct 18, 2012 5:11 pm
by NaasDup
Jim this is excellent and oh so obvious. How did I miss that?

Thank you.

However it is still not perfect because I think it is a feature that would be very easy to do for Textpad developers.