![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help capturing end of line numbers | icalderus | SUN Solaris | 3 | 09-20-2007 11:34 PM |
| generating random numbers with hamming distance 4 | hack_tom | Shell Programming and Scripting | 2 | 04-28-2007 10:27 PM |
| add line numbers | esham | Shell Programming and Scripting | 4 | 03-07-2005 07:46 AM |
| Printing line numbers | MizzGail | UNIX for Dummies Questions & Answers | 2 | 07-25-2002 01:18 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
generating line numbers
hello All
Do anybody know how to generat number line that is puting the number of lines at the begining of a new line, with d bracket by the side say 1) 2) 3) any help would be nice |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
The "Similar Threads" at the bottom of this page would be a good place to start. (Too bad the forums don't display that until you have posted your question.)
|
|
#3
|
|||
|
|||
|
I kjnow the cat -n works but puting the ) after each number line is complicated bit
|
|
#4
|
|||
|
|||
|
Code:
cat -n "$file" | sed -e 's/^ *[1-9][0-9]*/&)/' Actually this is probably easier in awk. Code:
awk '{ print NR ") " $0 }' "$file"
Last edited by era; 04-28-2008 at 02:20 PM. Reason: awk too |
|
#6
|
||||
|
||||
|
Code:
nl -s\)\ -w1 file |
|
#7
|
|||
|
|||
|
any other way without the sed and awk plssss
|
|||
| Google The UNIX and Linux Forums |