Hi guys,
As very soon will be very clear I'm very much a beginner. If I hadn't been, I'd probably find a neat expression to fill in the "very" for me :p Anyway - I hope someone here could help me out with an expression I've been looking at to save some time editing an excel worksheet.
The sample text I have is the following:
Load
#=MROUND(('Testing Program'!L28)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!M__);2,5;'Testing Program'!M__))-'Testing Program'!I__
#=MROUND(('Testing Program'!L29)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!M__);2,5;'Testing Program'!M__))-'Testing Program'!I__
#=MROUND(('Testing Program'!L32)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!M__);2,5;'Testing Program'!M__))-'Testing Program'!I__
Load
#=MROUND(('Testing Program'!E35)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
#=MROUND(('Testing Program'!E37)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
#=MROUND(('Testing Program'!E39)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
#=MROUND(('Testing Program'!E41)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
#=MROUND(('Testing Program'!E43)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
Load
#=MROUND(('Testing Program'!L30)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!M__);2,5;'Testing Program'!M__))-'Testing Program'!I__
#=MROUND(('Testing Program'!L31)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!M__);2,5;'Testing Program'!M__))-'Testing Program'!I__
#=MROUND(('Testing Program'!L33)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!M__);2,5;'Testing Program'!M__))-'Testing Program'!I__
Load
#=MROUND(('Testing Program'!E36)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
#=MROUND(('Testing Program'!E38)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
#=MROUND(('Testing Program'!E40)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
#=MROUND(('Testing Program'!E42)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
#=MROUND(('Testing Program'!E44)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
What I need is to make a regex that will take the row number from the first part and replace it with the underscores.
Example:
#=MROUND(('Testing Program'!L28)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!M__);2,5;'Testing Program'!M__))-'Testing Program'!I__
=>
#=MROUND(('Testing Program'!L28)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!M28);2,5;'Testing Program'!M28))-'Testing Program'!I28
and
#=MROUND(('Testing Program'!E35)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F_);2,5;'Testing Program'!F_))-'Testing Program'!B_
=>
#=MROUND(('Testing Program'!E35)*(AW6/100);2,5);IF(ISBLANK('Testing Program'!F35);2,5;'Testing Program'!F35))-'Testing Program'!B35
What I have tried:
I haven't really come far. I've pasted the above text into the sample part of the test mode tab. I've played around with just some basic stuff, but I'm even not sure if I need to escape the text in the sample text part or not - or which characters need to be escaped. I've done a little bit of regex some twenty years ago, but mostly plain text from log files, and then mostly searching.
This is what I have for my regular expression, but running validate doesn't even match a single thing:
\#=MROUND\(\(\'Testing Program\'!([L]+L)(\d)\)*\(AW\d/100\);2,5\);IF\(ISBLANK\(\'Testing Program\'!M__\);2,5;\'Testing Program\'!M__\)\)-\'Testing Program\'!I__
I would be extremely grateful for any help you can give me. This will be a really nice learning experience for me.
Thanks!