Re: Shell stripting

From: Bill Verzal (Bill_Verzal@BCBSIL.COM)
Date: Wed Mar 19 2003 - 15:25:47 EST


Use "wc" to count the lines and use "expr" to do the math for the "tail"
command.

BV
--------------------------------------------------------------------------------------------------------
Bill Verzal
Technical Consultant
Forbes Technical Consulting
(312) 653-3684
bill_verzal@bcbsil.com
billverzal@imcingular.com (Pager)
888-428-4025 (Pager)
MailStop: 27.202B

"Adam Hanel" <hanela@BILLINGS.K12.MT.US>
Sent by: "IBM AIX Discussion List" <aix-l@Princeton.EDU>
03/19/2003 02:25 PM
Please respond to "IBM AIX Discussion List"

        To: aix-l@Princeton.EDU
        cc:
        Subject: Re: Shell stripting

What if the file grows periodically? Say 5-10 lines a week. I would
still
only want the first 69 lines, then the rest of the file, split into two
separate files.

-Adam

-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On Behalf Of
Matt
Lawrence
Sent: Wednesday, March 19, 2003 11:59 AM
To: aix-l@Princeton.EDU
Subject: Re: Shell stripting

On Wed, 19 Mar 2003, Adam Hanel wrote:

> I need to split a 901 line file, into two files. One file with the
first
69
> lines, and the second file with the remaining 832 lines.

head -69 <file>
tail -832 <file>

-- Matt

**********
The information contained in this communication is confidential, private, proprietary, or otherwise privileged and is intended only for the use of the addressee. Unauthorized use, disclosure, distribution or copying is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender immediately at (312)653-6000 in Illinois; (972)766-6900 in Texas; or (800)835-8699 in New Mexico.
**********



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:41 EDT