![]() |
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 |
| Printing out pattern in line | FK_Daemon | Shell Programming and Scripting | 3 | 11-23-2007 04:27 PM |
| Printing a Line from a file | Nysif Steve | UNIX for Dummies Questions & Answers | 4 | 08-31-2007 07:58 AM |
| printing a line number using awk | rjsha1 | Shell Programming and Scripting | 3 | 09-01-2006 09:25 AM |
| Creating a line for printing | jhansrod | Shell Programming and Scripting | 3 | 06-17-2005 05:38 AM |
| Printing line numbers | MizzGail | UNIX for Dummies Questions & Answers | 2 | 07-25-2002 04:18 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
printing the next line too??
Hi, I'm trying to get awk to print every line ending with a colon along with the next line. I have a file like:
Blah Blah a bunch of words, the money things are as follows: Spokane 340,087, 000 3.24500% January 23, 2008 does anyone have any advice on this matter? I'm a bit stumped... Thanks |
|
||||
|
awk
Hi
Try follow code: input: Code:
This is the first line This is the second line: This is the third line This is the forth line: This is the fifth line This is the last line Code:
This is the second line: This is the third line This is the forth line: This is the fifth line Code:
nawk '
/:$/{
print
getline
print
}' filename
|
![]() |
| Bookmarks |
| Tags |
| nawk, sed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|