The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
weird behavior of grep -P pankai Shell Programming and Scripting 2 12-20-2007 01:38 PM
New Style Ralf Post Here to Contact Site Administrators and Moderators 1 06-17-2003 12:50 PM
Style not working right criglerj Post Here to Contact Site Administrators and Moderators 3 11-25-2002 12:35 PM
oops! Style Manager kristy UNIX for Dummies Questions & Answers 1 12-14-2001 02:07 PM

Reply
 
LinkBack Thread Tools Display Modes
  #8 (permalink)  
Old 05-16-2008
Registered User
 

Join Date: Jan 2007
Posts: 24
the best....
Reply With Quote
Forum Sponsor
  #9 (permalink)  
Old 05-16-2008
Registered User
 

Join Date: May 2008
Posts: 51
Quote:
awk -F "*" '/xxx/ { print $2 }' file
awk: syntax error near line 1
awk: bailing out near line 1
Reply With Quote
  #10 (permalink)  
Old 05-17-2008
Registered User
 

Join Date: May 2008
Posts: 51
bump need help
Reply With Quote
  #11 (permalink)  
Old 05-17-2008
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 415
Quote:
Originally Posted by finalight View Post
bump need help
Don't bump your question, forum rules

Code:
Vsl Voy Port Sz Cat Wt Block Slot Row Qty Crane OperCode ResvFor
carrier name 6113A xxxx 40 GP M U02 25 8 1 0
*some space* xxxx 40 HC M U02 25 8 1 0
*some space* xxxx 40 HC H U02 25 7 3 0
Please redefine your data sample.
Reply With Quote
  #12 (permalink)  
Old 05-19-2008
Registered User
 

Join Date: May 2008
Posts: 51
i can't do more than one spacing, but there are five spacing between the first word and the 0th position
Reply With Quote
  #13 (permalink)  
Old 05-19-2008
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 415
Try this:
Code:
 awk '/xxxx/{p="xxxx";print substr($0,index($0,p),length($0)+1-index($0,p))}' data.file

Last edited by danmero; 05-19-2008 at 09:31 PM. Reason: make life complicated
Reply With Quote
  #14 (permalink)  
Old 05-19-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 2,707
If you still need help, use code tags to post a properly formatted sample.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0