![]() |
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 |
| please explain the below | mail2sant | Shell Programming and Scripting | 1 | 04-04-2008 08:04 AM |
| Please can any one explain this ${0##/} | gadege | Shell Programming and Scripting | 2 | 04-01-2008 03:26 PM |
| please explain this | dummy_needhelp | Shell Programming and Scripting | 2 | 10-15-2007 01:17 AM |
| Can anyone explain plz | r_W213 | UNIX for Advanced & Expert Users | 3 | 03-27-2007 04:52 AM |
| if [ $? -eq 0 ] .. can someone explain this? | ranjita.c | Shell Programming and Scripting | 5 | 10-03-2006 07:50 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Explain awk
Hi,
I found this command in this forum, but, couldnt understand much from it. could any one help me understand that??? the commands are : Code:
awk '{sub(/ ~/,""); printf $0 ($0~/\|$/?ORS:"")}' file1 > file2
awk '{sub(/~ */,x);printf $0(/\|$/?ORS:x)}'
awk '{sub(/~ */,x);sub(/\|$/, "|\n")}8' ORS="" file1 >file2
Code:
existing file data: 24|john|account ~ info |56| 25|kuo|account ~ journal |58| 27|kim|account ~ journal |59| 28|San|account ~ journal |60| 29|jay|account ~ journal |26| 29|Nan|account ~ journal |66| 30|Kee|account ~ journal |27| Output: 24|john|account info |56| 25|kuo|account journal |58| 27|kim|account journal |59| 28|San|account journal |60| 29|jay|account journal |26| 29|Nan|account journal |66| 30|Kee|account journal |27| |
|
||||
|
Quote:
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|