I have a .dat file which looks like this:
NGC0448 A3D:2010B g:o,r:o,i:o
NGC0474 A3D:2011A,2013A g:o,r:o,i:o,u:o
Now I want to align them to be in this form:
NGC0448 A3D:2010B g:o,r:o,i:o
NGC0474 A3D:2011A,2013A g:o,r:o,i:o,u:o
I tried with C-u M-X align
and M-x align-regexp
with=
but neither works. Can someone come up with a solution?
Why did you try to align on =
?? There isn't a single =
in that example text.
Assuming your example is representative, you can align on the spaces. I'll use \s-
(whitespace syntax) instead of an actual space, as the latter is harder to see.
C-uM-x align-regexp
RET
\(\s-*\)\s-
1
3
y