The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Need to split the file
.
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
:
Need to split the file
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
08-31-2006
mbketan
Registered User
Join Date: Jun 2006
Posts: 9
one method is to use awk if the pattern position is known.....little lengthy....but works fine....
awk '{
if(substr($0,1,5)=="pattern")
{
fn="outfile" n++
print $0 >> fn
}
else
print $0 >> fn
}' file_name
cheers
mbketan
View Public Profile
Find all posts by mbketan
Find mbketan's past nominations received
Find mbketan's present nominations given