The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
How to extract first column with a specific character
.
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
:
How to extract first column with a specific character
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
05-22-2008
era
Herder of Useless Cats (On Sabbatical)
Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
If the current line matches I at start of line (that's the caret ^), replace the whole line with just the part which matched (that's what the parentheses are for; they capture the match into \1) and print it.
era
View Public Profile
Visit era's homepage!
Find all posts by era
Find era's past nominations received
Find era's present nominations given