The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
grep or awk problem, unable to extract numbers
.
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
:
grep or awk problem, unable to extract numbers
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
08-31-2007
charbel
Registered User
Join Date: Feb 2006
Posts: 41
Is that number composed of 5 digits only?
if YES, then you can use the awk command and you can print that substring only....
code:
cat input.txt|awk 'BEGIN {FS=":"} {print substr($2,1,5)}'
this may help.....
charbel
View Public Profile
Find all posts by charbel
Find charbel's past nominations received
Find charbel's present nominations given