Thanks to Steve for this pearl of VI wisdom.
For search and replace operation in VI, parenthesis remembers the item. This can be used for custom replacements later. Try the command below on a file with this data:
29 5 2010
30 6 2011
:1,$s/[0-9]* \([0-9]*\) \([0-9]*\)/\2 \1/
VI can remember 9 such fields.
This web log is my online notebook for software tips and hacks to make my life and hopefully that of someone else just a little bit easy. Should you find any mistakes or have any useful suggestions, please do not hesitate to write to me. Peace! Pavan Ghatty
No comments:
Post a Comment