Matching blocks of text and outputting to notepad

Posted by Tsheller on Fri 18 May 2007 08:18 AM — 3 posts, 17,648 views.

USA #0
I would like to have some kind of script or trigger to match on several lines for specific data, and then write the matched data in a specific format to a notepad file, as an example..


>score
St 100(100)/+ 69 Co 100(100)/+ 45
Qu 100(100)/+ 61 Ag 100(100)/+ 61
Pr 77( 77)/+ 16 Sd 100(100)/+ 25
Em 100(100)/+ 40 Me 80( 80)/+ 23
In 93( 93)/+ 25 Re 97( 99)/+ 48

I would like the output to simply spot the St, Qu, Pr, etc, and then write it out as:

100(100)+69, 100(100)/+61, 77(77)/+ 16, and so on. Anyone know the best or easiest way to do this?

Edit: Something I missed the first time is that there are some things I -don't- want it to match.
Amended on Fri 18 May 2007 10:08 AM by Tsheller
#1
St 100(100)/+ 69

is this what you would be looking for (in regex)?

^(St|Qu|Pr|etc) (\d{2,3})\((\d{2,3})\)/\+ (\d{2,3})

here, %2 would hold "100", %3 would hold "100", %4 would hold "69", and %0 would hold "St 100(100)/+ 69" where to send if from there I wouldn't know, but it seems you do. this would trigger on the following in words:

(start of the line)(Sr or Qu or etc) (2 or 3 numbers)((2 or 3 numbers))/+ (2 or 3 numbers)
Australia Forum Administrator #2
Did you read http://mushclient.com/faq points 23 and 37?