Let's say a text file looks like so:
0.00 33.90 -93.9
0.00 43.90 -93.9
10.00 53.90 -93.9
10.00 63.90 -93.9
-100.00 10.00 -7.0
-100.00 9.00 -8.0
100.00 9.00 -9.0
100.00 63.00 -10.0
What would be the appropriate emacs command to line up the text so it appear like this:
0.00 33.90 -93.9
0.00 43.90 -93.9
10.00 53.90 -93.9
10.00 63.90 -93.9
-100.00 10.00 -7.0
-100.00 9.00 -8.0
100.00 9.00 -9.0
100.00 63.00 -10.0
The floats need to align vertically at the decimal point. I'm familiar with align-regexp, but I don't know what align-rule-list I should use.
The following function does not work perfectly but it should get you started. The
justifyattribute is important to align at the decimal point. But, there is no optionaljustifyargument foralign-regexp. To see the meaning of the attributes consult the help ofalign-rules-list.