I've got a file with a structure like this:
M: a
M: b
Player: c
M: d
Sequencer.Play( SpineAnimation(foo, speaker)@0 )
Player: e
M: f
Sequencer.Play( SpineAnimation(bar, speaker)@0 )
...
How do I convert this into a file like this:
M: a
M: b
Player: c
M foo: d
Player: e
M bar: f
...
In other words, if the next line has Sequencer.Play( SpineAnimation(...
, I want to take the word after it and put it before the colon on the current line.
Not sure what the best tool for this would be, I'm thinking awk, but then again, I think it'll be pretty hairy with that tool. I'm open to use any command to accomplish this. I tried to do something like the answer here: Merge two lines into one picking selected words from both But this question seems non-trivially different because the Sequencer.Play
line isn't always there.