![]() |
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 |
| cat file1 read line-per-line then grep -A 15 lines down in fileb | irongeekio | Shell Programming and Scripting | 6 | 01-28-2009 06:30 AM |
| Joining lines in reverse. append line 1 to line 2. | dwalley | Shell Programming and Scripting | 7 | 08-04-2008 07:11 AM |
| Appending line number to each line and getting total number of lines | chiru_h | Shell Programming and Scripting | 2 | 03-25-2008 10:19 AM |
| to make 2 lines into 1 line using awk | cdfd123 | Shell Programming and Scripting | 2 | 10-03-2007 07:44 PM |
| Appending line/lines with sed | nir_s | Shell Programming and Scripting | 28 | 07-24-2005 02:36 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Awk 2 lines to 1 line
Input File:
Quote:
Quote:
Code:
nawk '{for(i=1; i<=NR; i+2) {print NR,$0; getline ;print \n $0; NR=NR+2}}' temp
Help is appreciated |
|
||||
|
Quote:
Minor change; need output comma seperated. I have tried this but has syntax error. Code:
nawk '{ORS=(FNR%2)?FS:RS}; OFS=,' temp
|
|
||||
|
Awk with weird spaces (output from sybase server)
When i pasted input file on website. i have some weird spaces but when i pasted i think website removed it. hence i am attaching it.
Requried Result host1,server1,database1,5 host2,server2,database2,5 host3,server3,database3,5 Result i am getting is also attached Appreciate help |
| Sponsored Links | ||
|
|