Page 1 of 1

sort results of "search in all files"

Posted: Fri Feb 16, 2007 4:51 pm
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?

Posted: Fri Feb 16, 2007 5:38 pm
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]+)\):

Posted: Tue Feb 20, 2007 4:55 am
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

Posted: Tue Feb 20, 2007 1:08 pm
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.