![]() |
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 |
| egrep syntax question | DKNUCKLES | Shell Programming and Scripting | 1 | 11-18-2007 04:46 PM |
| Simple Awk Question: If Syntax | natdeamer | Shell Programming and Scripting | 1 | 09-10-2007 12:53 PM |
| C-shell: variable syntax question | alex_5161 | SUN Solaris | 0 | 01-30-2007 02:43 PM |
| Question: non-recursive find syntax | alexkav | UNIX for Dummies Questions & Answers | 6 | 03-10-2005 07:46 AM |
| awk syntax question | hcclnoodles | Shell Programming and Scripting | 2 | 10-28-2004 12:45 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
yet another awk field syntax question
I am trying to print the remaing fields and field numbers beginning with a field 'xyz'
Code:
#cat abc test1:test2:xyz:test3:test4:test5 #cat def test1:test2:test3:xyz:test4:test5 test3 3 or test4 3 or test5 3 likewise, test4 2 or test5 2 placeing a field separator as 'xyz' illiminates using ':' as a second separator or is that possible? |
|
||||
|
I'm gonna use sed for the time being, but would like to know the correct awk syntax as well
cat abc | sed 's/\(.*\)xyz://' | awk -F: '{print $1,NF}' edit* Quote:
|
|
||||
|
Quote:
|
|
||||
|
Quote:
thanks again |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|