Is there a way to covert such block of lines
line1
line2
linen
into
1. line1
2. line2
n. linen
Using Emac
Found this on emacsworld.blogspot.com (I made some minor edits):
In Emacs 24.1, the NEWS file had this new addition to the rectangle commands.
** New command `C-x r N' (`rectangle-number-lines') numbers the lines in the current rectangle. With a prefix argument, this prompts for a number to count from and for a format string.
This allows you to now number lines or lists easily without using a macro or additional elisp functions. Mark a vertical region of text (using transient mark mode may help), 1 character wide, and then hit C-x r N and that's it. Emacs numbers the lines.
If you use the prefix command C-u (for example, C-u C-x r N), it will prompt you for a starting digit and the format string, so you can start at an arbitrary number and specify a period or paren or whatever to precede or follow the number.