The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Extract single or multi word string in Cshell
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Extract single or multi word string in Cshell
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
02-11-2009
vgersh99
Moderator
Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Code:
echo 'COMP. XYZ Public Company :COMPANY NAME' |
sed
's/^[^ ][^ ]* *\([^:][^:]*\)[ ][ ]*:.*/\1/'
Last edited by vgersh99; 02-11-2009 at
02:49 PM
.. Reason: rid of the trailing spaces
vgersh99
View Public Profile
Find all posts by vgersh99
Find vgersh99's past nominations received
Find vgersh99's present nominations given