auto repetition of regex-based search & replace
Submitted by Thursday, 22 April, 2004 - 15:43
on
I need to process long lists of index records (many thousands of entries), to convert from a format prepared for print publication to a database-oriented format. Specifically, where the first word(s) in a record is repeated in the following record the repetition is implied by indentation (effectively whitespace). For example:
Abadham, Harvey v. H65/24
Abarrow, Radford v. R23/47
Abbes, Claxton v. C129/19
...Kinwellmarsh v. K26/98
...Parmenter v. P40/32
Abbey, Clarke v. C114/23
...Harrison Kt. v. H95/24
...Snawsdale v. S49/3
...Tooker v. T19/22,61/127
Abbott, Antram v. A8/41
...Ashton v. A7/55
...Bacon v. B44/22
...Ballard v. B110/40
...Kt., Barnes v. B12/64
...Battersby v. B135/12
["..." = whitespace]
I can find and replace the "indent" by the required string OK, using a tagged regex string to search. But after the replace is done, the search stops and I need to click the replace button again to do the next replacement; "replace all" doesn't seem to work (maybe because the search string value is dynamic??).
I have a lot of this type of work to do, and was trying to avoid having to write code - and the approach seems almost to work, if I didn't have the problem that the search stops. I have also tried TextPad, which has the same problem, and it appears that Ultraedit will be the same.
Any ideas?
Ian Galbraith
Abadham, Harvey v. H65/24
Abarrow, Radford v. R23/47
Abbes, Claxton v. C129/19
...Kinwellmarsh v. K26/98
...Parmenter v. P40/32
Abbey, Clarke v. C114/23
...Harrison Kt. v. H95/24
...Snawsdale v. S49/3
...Tooker v. T19/22,61/127
Abbott, Antram v. A8/41
...Ashton v. A7/55
...Bacon v. B44/22
...Ballard v. B110/40
...Kt., Barnes v. B12/64
...Battersby v. B135/12
["..." = whitespace]
I can find and replace the "indent" by the required string OK, using a tagged regex string to search. But after the replace is done, the search stops and I need to click the replace button again to do the next replacement; "replace all" doesn't seem to work (maybe because the search string value is dynamic??).
I have a lot of this type of work to do, and was trying to avoid having to write code - and the approach seems almost to work, if I didn't have the problem that the search stops. I have also tried TextPad, which has the same problem, and it appears that Ultraedit will be the same.
Any ideas?
Ian Galbraith