Page 1 of 1

Macro Replace On Multiline while using wildcard.

Posted: Tue May 29, 2007 3:17 pm
by jeffrey1790
I would like to be able to do this:


Ex of text file.

#NOTES:
dance-single:
Renard:
Challenge:
109: <----------------(RATING)
0.840,0.925,0.279,0.192,1.000:
0000
0000
0000
0000


#NOTES:
dance-single:
Renard:
Hard:
93: <----------------(RATING)
0.840,0.925,0.279,0.192,1.000:
0000
0000
0000
0000


#NOTES:
dance-single:
Renard:
Medium:
46: <----------------(RATING)
0.840,0.925,0.279,0.192,1.000:
0000
0000
0000
0000


#NOTES:
dance-single:
Renard:
Easy
24: <----------------(RATING)
0.840,0.925,0.279,0.192,1.000:
0000
0000
0000
0000


Replace The Last digit from the number underneath Challenge, Medium, Easy or Hard and remove it completely.

NOTE: i will need to be able to replace over 400 of these located in seperate folders

link for example file:

http://www.jeffrey1790.com/children.sm

Thanks,
Jeff
jeff@jeffrey1790.com

Posted: Tue May 29, 2007 4:22 pm
by Abacre
It's possible to do with Advanced Find and Replace.
Question: what resulting text should be for your example?

Posted: Tue May 29, 2007 5:22 pm
by jeffrey1790
FINAL WHAT I WANT!

#NOTES:
dance-single:
Renard:
Challenge:
10: <------(NO DECIMAL)
0.840,0.925,0.279,0.192,1.000:
0000
0000
0000
0000


#NOTES:
dance-single:
Renard:
Hard:
9: <------(NO DECIMAL)
0.840,0.925,0.279,0.192,1.000:
0000
0000
0000
0000


#NOTES:
dance-single:
Renard:
Medium:
4: <------(NO DECIMAL)
0.840,0.925,0.279,0.192,1.000:
0000
0000
0000
0000


#NOTES:
dance-single:
Renard:
Easy
2:<------(NO DECIMAL)
0.840,0.925,0.279,0.192,1.000:
0000
0000
0000
0000

Posted: Wed May 30, 2007 7:32 pm
by Abacre
Go to main menu - Action - Options - Batch Replace
check "Modifier S"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
(#NOTES:\r\ndance-single:.*\d+)\d:
Replace with:
$1:

That's all I verified it works perfectly.

Posted: Wed May 30, 2007 7:54 pm
by jeffrey1790
at the bottom of the window it says 0 files of 456 and doesnt work.

Posted: Wed May 30, 2007 7:56 pm
by Abacre
Please send a sample file to support@abacre.com
It's probably a problem of trailing spaces.

Posted: Wed May 30, 2007 8:04 pm
by jeffrey1790
i sent the sample file

Posted: Wed May 30, 2007 8:05 pm
by Abacre
Thank you for the file.
Yes, indeed, it was a problem of trailing spaces before dance-single: text

Therefore use Search For:
(#NOTES:.*\d+)\d:

Posted: Wed May 30, 2007 8:07 pm
by jeffrey1790
and replace with $1: right?

Posted: Wed May 30, 2007 8:11 pm
by jeffrey1790
HOLY CRAP..........I LOVE THIS PROGRAM! THANKS

Posted: Wed May 30, 2007 8:11 pm
by Abacre
Exactly, replace it with $1:

In fact $1 will take text located between () in Search For part.
and : is a separator after last digit defined by \d