jEdit Community - Resources for users of the jEdit Text Editor
auto repetition of regex-based search & replace
Submitted by Anonymous on Thursday, 22 April, 2004 - 15:43
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
User login
Browse archives
« March 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82339
Context Free Art (*.cfdg)   0.31   46046
JBuilder scheme   .001   18487
BBEdit scheme   1.0   18108
ColdFusion scheme   1.0   18016
R Edit Mode - extensive version   0.1   17465
Advanced HTML edit mode   1.0   16198
Matlab Edit Mode   1.0   16060
jEdit XP icons   1.0   15221
XP icons for jEdit   1.1   14285