![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help in sed command (adding a blank line btw each block generated by pattern) | frozensmilz | Shell Programming and Scripting | 2 | 01-08-2009 12:12 AM |
| make multiple line containing a pattern into single line | VTAWKVT | Shell Programming and Scripting | 13 | 12-04-2008 06:40 PM |
| comment/delete a particular pattern starting from second line of the matching pattern | imas | Shell Programming and Scripting | 4 | 10-13-2008 02:37 AM |
| Printing out pattern in line | FK_Daemon | Shell Programming and Scripting | 3 | 11-23-2007 04:27 PM |
| sed - Replace Line which contains the Pattern match with a new line | kousikan | Shell Programming and Scripting | 2 | 03-24-2007 07:24 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Have you tried grep? This gives the number of the line and the line delimited by a colon:
Code:
grep -n <pattern> <file> Code:
grep -n <pattern> <file>| cut -d: -f1 Regards |
|
||||
|
Quote:
help me...... |
|
||||
|
get line number using sed command
Hi,
If the file is as given below, please let me know if the command is right to get the like number containing the string - Earth with the "=" symbol. Filename: example.txt 123|Earth|2009 sed '/Earth/ { = }' example.txt |
| Sponsored Links | ||
|
|