The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Split file using awk
.
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
:
Split file using awk
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
8
(
permalink
)
07-21-2004
Ygor
Moderator
Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
Moving things around...
Code:
awk '/^END/{close f; f=""} f{print > f} /^DOC/{f="doc."++d}' infile
$ head -1000000 doc.*
==> doc.1 <==
aaaaaa
bbbbbb
cccccccc
==> doc.2 <==
ddddddd
eeeeeee
Ygor
View Public Profile
Find all posts by Ygor
Find Ygor's past nominations received
Find Ygor's present nominations given