This example shows how you can use the Sequence panel in PowerGREP to run an extra search-and-replace on each target file produced by a PowerGREP action. This is different from the “extra processing” part of a PowerGREP action. This is different from the “extra processing” feature on the Action panel, which performs an extra search-and-replace on each replacement text or each text to be collected, handling each bit of text separately. The Sequence panel allows you to run a whole new action on the target files, reprocessing each file as a whole.
Suppose you want to condense consecutive spaces into single spaces in your target files when running a “collect data” action. If you used the “extra processing” feature to search for {2,} and replace with a single space, you’d condense consecutive spaces within each search match that is collected into the file. But if one search match ends with a single space and the next match starts with a single space, the target file will still end up with two consecutive spaces. The reason is that the “extra processing” processes each search match separately. It sees a single space at the end of the first match, and a single space at the start of the second match, neither of which are replaced because the regex doesn’t match them. To condense all consecutive spaces, even those that were part of different matches, we need to search for {2,} through the target file as a whole.