A couple of hours of unsuccesfull attempts and I'm ready to give in, but before I do so I'd appreciate any suggestions please.
I want content like this :
*** "Status - Category or Overlay"
Count entries in category (no display): 5
*** "Icons - Making new ones"
*** "Overlay name to variable + registry"
Track: Test for GPS data: 6
Find any GPX on C: with that overlay name: 3
Timestamps (add): 9
Track to GE + files (single, silent): 12
Open track in GPSU: 10
*** "Capture current mark position"
to become alphabetically organised by the 'headers', like this:
*** "Capture current mark position"
*** "Icons - Making new ones"
*** "Overlay name to variable + registry"
Track: Test for GPS data: 6
Find any GPX on C: with that overlay name: 3
Timestamps (add): 9
Track to GE + files (single, silent): 12
Open track in GPSU: 10
*** "Status - Category or Overlay"
Count entries in category (no display): 5
(Note that some headers have no following entries.)
Even better would be for the entries to be sorted alphabetically too, like this:
*** "Capture current mark position"
*** "Icons - Making new ones"
*** "Overlay name to variable + registry"
Find any GPX on C: with that overlay name: 3
Open track in GPSU: 10
Timestamps (add): 9
Track: Test for GPS data: 6
Track to GE + files (single, silent): 12
*** "Status - Category or Overlay"
Count entries in category (no display): 5
Beyond the scope of TextPad?
--
Terry, East Grinstead, UK
Is this 'group sorting' amenable to Regex?
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
You can sort the groups in three steps.
1. Replace each newline that is not followed by *** by some string that doesn't occur elsewhere, say ~~~~ .
3. Replace each ~~~~ with newline:
1. Replace each newline that is not followed by *** by some string that doesn't occur elsewhere, say ~~~~ .
2. Sort the lines.Find what: \n(?!^\*\*\*)
Replace with: ~~~~
3. Replace each ~~~~ with newline:
Sorting the records within the groups is a job for a script.Find what: ~~~~
Replace with: \n
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm