9

I've been trying to record a rather simple macro with two substitutions. The whole macro is: dd"+pkdd:%s/\t/, /g :%s/ \(kb\d\+\),/ \1.0,/g "+y$

However, the second substitution is there to reformat numbers from a format 123 to 123.0 but the input does not always need the substitution so it fails. When it fails the whole macro stops so the last part ("+y$) does not execute.

Is there any way to prevent this?

1 Answer 1

9

I've figured it out thanks to this. One needs to put an e flag to the substitution so the substitution looks like this: :%s/ \(kb\d\+\),/ \1.0,/ge. e suppresses the error message and lets the macro finish.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.