I was wondering if there was a way to use macros, and automaticly increase a value for each time its ran. For example:
ABCDEF 1
ABCDEF 2
ABCDEF 3
etc.
Is this posible?
"Counting" macros
Moderators: AmigoJack, bbadmin, helios, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
You can use TextPad's regexes for this.
For example, if you want 100 lines with the prefix "ABCDEF ", insert those 100 with just the prefix; then select all of them, and
For example, if you want 100 lines with the prefix "ABCDEF ", insert those 100 with just the prefix; then select all of them, and
The regex $ matches ends of lines; the replacement expression \i inserts incrementing sequence numbers.Find what: $
Replace with: \i
[X] Regular expression
Replace All
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Hello,
I'm stuck at a similar point but have about 700 such unique combinations that need to be counted separately. Can someone please help me?
If it helps, I've got them sorted. Is there one single regex that I can run to maybe look at the previous line and compare the keys? The keys are always the first 17 characters of each line.
E.g.,
1234567890,ABC,XY,blah,blah,blah-a
1234567890,ABC,XY,blah,blah,blah-b
1234567809,ABD,XY,blah,blah,blah-a
1234567809,ABD,XY,blah,blah,blah-b
1234567809,ABD,XY,blah,blah,blah-c
1234567809,ABD,XY,blah,blah,blah-d
What I like to achieve:
1234567890,ABC,XY,0,blah,blah,blah-a
1234567890,ABC,XY,1,blah,blah,blah-b
1234567809,ABD,XY,0,blah,blah,blah-a
1234567809,ABD,XY,1,blah,blah,blah-b
1234567809,ABD,XY,2,blah,blah,blah-c
1234567809,ABD,XY,3,blah,blah,blah-d
If counts cannot start with 0, then I suppose I could handle that part later in Excel or something.
I apologize if this has been posted earlier. I searched but couldn't find any answers.
Thanks in advance,
Andy
I'm stuck at a similar point but have about 700 such unique combinations that need to be counted separately. Can someone please help me?
If it helps, I've got them sorted. Is there one single regex that I can run to maybe look at the previous line and compare the keys? The keys are always the first 17 characters of each line.
E.g.,
1234567890,ABC,XY,blah,blah,blah-a
1234567890,ABC,XY,blah,blah,blah-b
1234567809,ABD,XY,blah,blah,blah-a
1234567809,ABD,XY,blah,blah,blah-b
1234567809,ABD,XY,blah,blah,blah-c
1234567809,ABD,XY,blah,blah,blah-d
What I like to achieve:
1234567890,ABC,XY,0,blah,blah,blah-a
1234567890,ABC,XY,1,blah,blah,blah-b
1234567809,ABD,XY,0,blah,blah,blah-a
1234567809,ABD,XY,1,blah,blah,blah-b
1234567809,ABD,XY,2,blah,blah,blah-c
1234567809,ABD,XY,3,blah,blah,blah-d
If counts cannot start with 0, then I suppose I could handle that part later in Excel or something.
I apologize if this has been posted earlier. I searched but couldn't find any answers.
Thanks in advance,
Andy
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
In TextPad you can automatically insert sequence numbers, but you can't find a line only if it begins with the same text as the following or preceding line.
In WildEdit you can find each line that begins with the same text as the following line with something like
(([^,]*,){3}).*\r?\n(?=\1)
but you can't automatically insert sequence numbers.
In WildEdit you can find each line that begins with the same text as the following line with something like
(([^,]*,){3}).*\r?\n(?=\1)
but you can't automatically insert sequence numbers.