Anyone know of code that will insert line numbers into a file
at the beginning of a line, and do things like skip blank
lines?
Scott
See command from my lisp libraries. (there is also ti::b-remove-line-numbers,
my-print-with-line-numbers )
jari
Pick URL ftp://cs.uta.fi/pub/ssjaaa/ or /f...@cs.uta.fi:/pub/ssjaaa/
(The "access denied" just means the site is busy; try a little later)
The main html page is named after my login name: ssjaaa.html
(defun ti::b-insert-line-numbers (beg end &optional line grow format)
"Inserts line numbers to buffer.
Mark the region where to insert the line numbers. C-x h to mark
whole buffer for insertion.
The default line format is '%02d:%s' for values lower that 100.
For bigger values the format is dynamical (digit len derived from
start value)
Input:
beg,end ,point ,area bounds
line ,nbr ,starting line number is 1 by default
grow ,nbr ,grow by 1 is default
format ,str ,how line is formatted, see above
...
>>>>> "Scott" == <sc...@lighthouse.softbase.com> writes:
Scott> Anyone know of code that will insert line numbers into a file
Scott> at the beginning of a line, and do things like skip blank
Scott> lines?
'cat' has some option to print with line number. i'm on NT and
don't have a cat handy.
for removing blank lines, try grep -v '^[ \t]*$'
--
#===# Vardhan Varma <Var...@Bitsmart.com>| An addicted NetHacker |
|PAR| Parsec Technologies (India) | An addicted Programmer |
|SEC| Fax and Voice processing systems +------------------------+
#===# Still looking for a quote witty enough to grace this place.. |
For god's sake, get MKS-tools, and then supplement
that with gnu grep, etc.
MKS-tools gives you k-shell, all the usual unix tools (eg cat),
etc. About $300?
For free you can get the GNU tools (a lot better than the "usual"
unix tools) from Cygnus for msdog and friends.
--
Emilio C. Lopes <mailto:Emilio...@Physik.TU-Muenchen.DE>