[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] splitting files based on keyword



On Tue, Jun 21, 2005 at 09:57:07PM -0400, kamaraju kusumanchi wrote:
> Is there any tool which will split the above file and give me three 
> smaller files  1-1-2005.txt, 1-2-2005.txt, 1-3-2005.txt etc., where

perl -pe 'open STDOUT, ">$1.txt" if /^date (.*)/' the-big-file

-- 
Dave Carrigan
Seattle, WA, USA
dave@rudedog.org | http://www.rudedog.org/ | ICQ:161669680
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL

Attachment: signature.asc
Description: Digital signature


Reply to: