Hello, @anthony-lovelady, @terry-r, @david-bailey, and All
As Terry, I was confused about the final goal of the OP. Luckily, Terry almost clarified the problem :-)
I say, “almost”, because we must take in account some other points :
We may consider that the initial text contains blocks, separated by blank lines. These blank lines must be deleted, before calling the Column editor !. Otherwise, the numbering wouldn’t be made of consecutive numbers :-((
May be, the lines Cheat0_N = and Cheat0_O= may contain numbers different from 0, like, for instance, Cheat28_N = or Cheat72_O=
Also, the word Cheat, in the original text, may be written in lower-case or with any case
Finally, Terry, I think that you forgot an equal sign =, after the part Cheat\d+, in the second regex, at STEP 3
So, given an initial text, as below :
Cheat0=“Arms Connect”,80047F77 0022,81047F88 1836,81047F96 E836
Cheat28_N =
Cheat72_O=
cheat3=“First_Test”,702A65B7 0198,658CC6D0 9215,8921BF80 C123
cheat3_N =
cheat3_O=
Cheat12=“Example”,C9245F81 990A,42C845D1 0000,95AD692F A23B
Cheat0_N =
Cheat2_O=
cheat07=“end of the Test”,004F2227 C52D,623C78B2 52F3,692A7D6C 5520
cheat00_N =
cheat100_O=
Then, this first regex S/R :
SEARCH (?i-s)Cheat\d+_(N|O).+\R?|(^\h+\R)+
REPLACE Leave EMPTY
Would give the text, below :
Cheat0=“Arms Connect”,80047F77 0022,81047F88 1836,81047F96 E836
cheat3=“First_Test”,702A65B7 0198,658CC6D0 9215,8921BF80 C123
Cheat12=“Example”,C9245F81 990A,42C845D1 0000,95AD692F A23B
cheat07=“end of the Test”,004F2227 C52D,623C78B2 52F3,692A7D6C 5520
Now, after performing the Column editor action, with a decimal starting number 0, we obtain :
0Cheat0=“Arms Connect”,80047F77 0022,81047F88 1836,81047F96 E836
1cheat3=“First_Test”,702A65B7 0198,658CC6D0 9215,8921BF80 C123
2Cheat12=“Example”,C9245F81 990A,42C845D1 0000,95AD692F A23B
3cheat07=“end of the Test”,004F2227 C52D,623C78B2 52F3,692A7D6C 5520
Finally, using the second regex S/R, below :
SEARCH (?i-s)(\d+)Cheat\d+=(.+?”),(.+)(\R)
REPLACE cheat\1_desc = \2\4cheat\1_enable = true\4cheat\1_code = “\3”\4
You should get the expected text :
cheat0_desc = “Arms Connect”
cheat0_enable = true
cheat0_code = “80047F77 0022,81047F88 1836,81047F96 E836”
cheat1_desc = “First_Test”
cheat1_enable = true
cheat1_code = “702A65B7 0198,658CC6D0 9215,8921BF80 C123”
cheat2_desc = “Example”
cheat2_enable = true
cheat2_code = “C9245F81 990A,42C845D1 0000,95AD692F A23B”
cheat3_desc = “end of the Test”
cheat3_enable = true
cheat3_code = “004F2227 C52D,623C78B2 52F3,692A7D6C 5520”
Best regards,
guy038