Shrink files/Better extract

Tool for Search and Replace across multiple files.
Post Reply
User avatar
SilentGuy

Shrink files/Better extract

Post by SilentGuy »

Hi!
I have a folder containing lots of text files. The all have a section at the beginning summarizing the content of the files. Now I want to extract only those lines. Sounds like a job for the extract feature, the problem is that I need to know which file this abstract came from.
So my next idea was to try to get it to replace all other lines with nothing, so that only the summary remains (would have run that on a copy of the folder, obviously), but that has the problem that it needs me to create a regex that matches the whole text in different groups, which kills the program (would have been surprised if this worked).

What I would like is to be able to either specify how extract extracts the text, e.g. use filename as prefix, add/don't add newlines between results, etc.

Another way would be to be able to tell it to perform my replace but drop every part of the text my regex did not touch, but I think that would be rather specific and potentially dangerous if used in error.
User avatar
DV

Post by DV »

Interesting problem. I can see that a feature to add the source file name before the extracted text would be very useful - I'll add this as an option to TC 2.1 (currently in development). Thanks!
Post Reply