sort results of "search in all files"

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
lindamarcella
Posts: 6
Joined: Wed Jun 16, 2004 3:09 am

sort results of "search in all files"

Post by lindamarcella »

I would have use for a feature that allowed sorting of the results page from sorting a search of all files in a folder, that keeps the property of being able to click on a matched line to go to the line in the file.

I mean, you can search for something in all files in a folder (and all subfolders if you wish). It gives a results page. To sort these results, you can copy the results output into a file and sort it. But you can't sort the output of the result page. The results page is sort of immobile, sort of like "read only", you can't change it.

The reason I would have use for this is I have several files of bibliographies from different journal articles. Each bibliography entry is a paragraph with some fields, like author, title, journal name. I search for the journal name field, and the results contain all the journals in the bibliographies.

Then I want to go to each line containing the journal field in alphabetical order, to look them up online. I can't sort the results that contain the links to go to the lines in the files. If I copy the results to a file, and sort it, then it's just a regular file, and loses the property of being able to click on a result to go to the corresponding line in a file.

Hope I'm making sense. I don't even know if TextPad is open source (I assume it's not), but if the innards or API was available, and I had the time, I'd consider trying to add this feature myself.

Does anyone else have a need for this feature?
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You can copy the current document, for example, one in which you've sorted the output of TextPad's search, (providing you've saved that document) into the Command Results window, by creating a DOS Command tool:
Parameters: type $File

[X] Capture output
Set the regular expression to match the output of the search:

In default regular expression syntax:
^\([^(]+\)(\([0-9]+\)):

In Posix regular expression syntax:
^([^(]+)\(([0-9]+)\):
lindamarcella
Posts: 6
Joined: Wed Jun 16, 2004 3:09 am

Post by lindamarcella »

Hi Ben,

Thank you very much for your response. It works!

I didn't understand the part about
Set the regular expression to match the output of the search:

In default regular expression syntax:
^\([^(]+\)(\([0-9]+\)):

In Posix regular expression syntax:
^([^(]+)\(([0-9]+)\):
What does this do?

Linda
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Have a look in TextPad's help, under How To... | Find and Replace Text | Regular Expressions to Match Compilation Errors.

In fact, it appears that the something similar to the regular expression I suggested is assumed by default, so that you don't need to specify it.
Post Reply