Sponsored Content
Full Discussion: add line numbers
Top Forums Shell Programming and Scripting add line numbers Post 65513 by Perderabo on Sunday 6th of March 2005 10:19:19 AM
Old 03-06-2005
Try:
nl -s " " -b a /path/to/text.file
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Printing line numbers

Maybe this question is out there, but I searched and didnt see it. To print my files I use more filename | lpr -Pprinter I would like to print my scripts with line numbers. How do I do this? (2 Replies)
Discussion started by: MizzGail
2 Replies

2. UNIX for Advanced & Expert Users

Add line numbers to end of each line

Hi i would like to add line numbers to end of each line in a file. I am able to do it in the front of each line using sed, but not able to add at the end of the file. Can anyone suggest The following code adds line number to start of each line sed = filename | sed 'N;s/\n/\t/' how can i... (5 Replies)
Discussion started by: rudoraj
5 Replies

3. Shell Programming and Scripting

Display Line numbers

Hi all experts, I am getting error in my shell scripts and i want to find out which lines is in errors. How i can display the line numbers . Is it NU command? Please give me some suggestions. (4 Replies)
Discussion started by: ma466
4 Replies

4. Shell Programming and Scripting

how to add line numbers in text file

Hi all How to add line numbers in text file.. ex abcd cdef result 1. abcd 2. cdef thx in advance (4 Replies)
Discussion started by: suryanarayana
4 Replies

5. Shell Programming and Scripting

More with line numbers

Hi All, How to get line numbers when we more on a file in LINUX thanks firestar (1 Reply)
Discussion started by: firestar
1 Replies

6. Shell Programming and Scripting

How to get evenly Line numbers?

hi there , i m new to unix , i d like to ask how can a get only even numbered lines matches with the word i search from txt file for example : 3461:1.D. The copyright laws of the place where you are located also govern 3471:1.E. Unless you have removed all references to Project... (17 Replies)
Discussion started by: brhn
17 Replies

7. UNIX for Dummies Questions & Answers

grep to get line numbers

I know if i use grep -n that the output will have the lines numbered but is there a way to grep the actually line number. so like this grep -n "one" /usr/dict/numbers 1:one 21:twenty-one 31:thirty-one 41:forty-one 51:fifty-one 61:sixty-one 71:seventy-one 81:eighty-one 91:ninety-one ... (1 Reply)
Discussion started by: alindner
1 Replies

8. Shell Programming and Scripting

Assign Line Numbers to each line of the file

Hi! I'm trying to assign line numbers to each line of the file for example consider the following.. The contents of the input file are hello how are you? I'm fine. How about you? I'm trying to get the following output.. 1 hello how are you? 2 I'm fine. 3 How about you? ... (8 Replies)
Discussion started by: abk07
8 Replies

9. Shell Programming and Scripting

How to add line numbers (multiples of 5: 0,5,10,15,20) to a text file?

Hi, I need to number the lines in my text file. I know how to do this with standard numbering (1,2,3,4, etc) but I need to count in multiples of 5, beginning 0,5,10,15... example existing file: abcd efg hijklm nopqrs desired output 0 abcd 5 efg 10 hijklm 15 ... (11 Replies)
Discussion started by: livbaddeley
11 Replies

10. Shell Programming and Scripting

Efficient awk way to add numbers in line fields

data.now: blah1,dah,blaha,sweet,games.log,5297484456,nagios-toin,529748456,on__host=93 SERVICE__ALERT_=51 Warning___The__results__of__service=16 Warning___on__host=92 Auto_save__of__retention__data__completed=1 Warning___Return=68 PASSIVE__SERVICE__CHECK_=53 ,1026--1313,1... (12 Replies)
Discussion started by: SkySmart
12 Replies
Set::Infinite::_recurrence(3pm) 			User Contributed Perl Documentation			   Set::Infinite::_recurrence(3pm)

NAME
Set::Infinite::_recurrence - Extends Set::Infinite with recurrence functions SYNOPSIS
$recurrence = $base_set->_recurrence ( &next, &previous ); DESCRIPTION
This is an internal class used by the DateTime::Set module. The API is subject to change. It provides all functionality provided by Set::Infinite, plus the ability to define recurrences with arbitrary objects, such as dates. METHODS
o _recurrence ( &next, &previous ) Creates a recurrence set. The set is defined inside a 'base set'. $recurrence = $base_set->_recurrence ( &next, &previous ); The recurrence functions take one argument, and return the 'next' or the 'previous' occurence. Example: defines the set of all 'integer numbers': use strict; use Set::Infinite::_recurrence; use POSIX qw(floor); # define the recurrence span my $forever = Set::Infinite::_recurrence->new( Set::Infinite::_recurrence::NEG_INFINITY, Set::Infinite::_recurrence::INFINITY ); my $recurrence = $forever->_recurrence( sub { # next floor( $_[0] + 1 ) }, sub { # previous my $tmp = floor( $_[0] ); $tmp < $_[0] ? $tmp : $_[0] - 1 }, ); print "sample recurrence ", $recurrence->intersection( -5, 5 ), " "; # sample recurrence -5,-4,-3,-2,-1,0,1,2,3,4,5 { my $x = 234.567; print "next occurence after $x = ", $recurrence->{param}[0]->( $x ), " "; # 235 print "previous occurence before $x = ", $recurrence->{param}[2]->( $x ), " "; # 234 } { my $x = 234; print "next occurence after $x = ", $recurrence->{param}[0]->( $x ), " "; # 235 print "previous occurence before $x = ", $recurrence->{param}[2]->( $x ), " "; # 233 } o is_forever Returns true if the set is a single span, ranging from -Infinity to Infinity. o _is_recurrence Returns true if the set is an unbounded recurrence, ranging from -Infinity to Infinity. CONSTANTS
o INFINITY The "Infinity" value. o NEG_INFINITY The "-Infinity" value. SUPPORT
Support is offered through the "datetime@perl.org" mailing list. Please report bugs using rt.cpan.org AUTHOR
Flavio Soibelmann Glock <fglock@gmail.com> The recurrence generation algorithm is based on an idea from Dave Rolsky. COPYRIGHT
Copyright (c) 2003 Flavio Soibelmann Glock. All rights reserved. This program is free software; you can distribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO
Set::Infinite DateTime::Set For details on the Perl DateTime Suite project please see <http://datetime.perl.org>. perl v5.12.4 2011-08-22 Set::Infinite::_recurrence(3pm)
All times are GMT -4. The time now is 10:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy