I was building a macro and as one of the final steps it is supposed to take a sorted column of numbers (created by earlier steps) entries in which are four characters -- 1-3 spaces followed by a 1-3 digit right-justified number -- and put numbers with the same 10s digit on the same line. ie.
1
3
6
11
14
18
21
27
34
becomes:
1 3 6
11 14 18
21 27
34
And tried to use the following REGEXP (Posix form -- sorry :-b)
( ..)(.)\n\1(.)
replaced by:
\1\2\1\3
(has to be repeated of course) but the idea is to match the first three characters and compare them to the first three on the next line and remove the newline if there's a match (this is based on a helpfile example -- and I've done it before, but with a previous version of TxPd) ... Textpad says this is not a valid REGEXP (but if I code it as:
( ..)(.)\n(\1)(.)
It says it doesn't MATCH anything (but is now apparently valid!!) !!
Any thoughts? I eventually entered:
( )(.)\n (.)
( .0)(.)\n .0(.)
( .1)(.)\n .1(.)
( .2)(.)\n .2(.)
( .3)(.)\n .3(.)
( .4)(.)\n .4(.)
( .5)(.)\n .5(.)
( .6)(.)\n .6(.)
( .7)(.)\n .7(.)
( .8)(.)\n .8(.)
( .9)(.)\n .9(.)
Which works (since the columns are sorted, but it's a pain and slightly dangerous, and I'm going to have to redo the macro soon anyway)
Using Tagged expressions
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard