Shrink files/Better extract
Posted: Mon Dec 20, 2010 6:13 pm
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.
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.