![]() |
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 |
| Perl: array, assigning multi-word sentences with quotes | gctaylor | Shell Programming and Scripting | 4 | 09-05-2008 02:11 PM |
| adding single word to multiple line. | paulds | Shell Programming and Scripting | 6 | 07-25-2008 06:31 PM |
| tar command help -- extract single file | icefish | UNIX for Dummies Questions & Answers | 7 | 07-01-2008 02:02 PM |
| perl newbie: how to extract an unknown word from a string | wolwy_pete | Shell Programming and Scripting | 3 | 03-23-2008 10:41 AM |
| tar: extract single file to different filepath | littleIdiot | Shell Programming and Scripting | 3 | 02-29-2008 09:41 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
|
||||
|
Thanks for the help. In both cases, the code extracted the string: "COMPANY NAME". What I'm hoping to get is (in my example) "XYZ Public Company", or whatever (delimited or non-delimited) string appears between "COMP." and ":COMPANY NAME".
Thanks, Paul H. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|