in reply to switching parts of a text
When you match the move strings, you can capture the information you need with a regular expression. If the string will always be like what you show, then this could be:
and then the line you want will be print WHATEVER "$2 := $1", since the first thing in paratheses goes into $1 and the second thing into $2. With some tuning up, that should cover your first two concerns.m/MOVE (\d+) TO ([\d\w]+)/
For the last one, if there won't be any other single-quotes, you could just perform a substitution. If you're expecting them in the strings, then you can do a substitution which includes the end of string character: $. That way, you'll only match the final single-quote. I hope this helps.
Hays
|
|---|