The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-11-2009
phudgens phudgens is offline
Registered User
  
 

Join Date: Feb 2009
Location: Denver
Posts: 40
Extract single or multi word string in Cshell

I am using the following code:

set LASInputFile = `ls *.[Ll][Aa][Ss] | head -1`
set COMPLine = `grep -i :COMPANY $LASInputFile`


to extract the following line from my input file:


COMP. XYZ Public Company :COMPANY NAME


I now need to extract the full name of the company which may be a single word or multiple words separated by white space as in this example. I study awk and sed but I just can't figure out how to code for this.

Thanks,

Paul H.
Denver