Could someone here write a small Elisp function for me?
What I would like Emacs to do is the following: I have a region like this:
[0.04579] [0.06569] [0.09507]
[0.12696] [0.27929] [0.51505]
[0.27959] [0.60903] [ 0.8672]
[0.55241] [0.89048] [0.93582]
[0.0399] [0.05806] [0.08848]
and I want to delete the square brackets and all spaces, and insert &
between the columns and \\
at the end.
0.04579&0.06569&0.09507\\
0.12696&0.27929&0.51505\\
0.27959&0.60903&0.8672\\
0.55241&0.89048&0.93582\\
0.0399&0.05806&0.08848\\
I have no idea about programming in Elisp (yet) and this function would make my life a lot easier right now. I tried defining some kind of macro with forward-word
but that didn't work.