Re: Dividing a large long lined file
Marcelo Ramos wrote:
>On Wed, Sep 01, 1999 at 06:40:42PM -0700, John Haggerty wrote:
>> I thought I would ask this question since it is about general unix and deb
>ian as well.
>> I have a file which is say about 700 characters wide and 2,000 characters
>long I wish to take this file and divide this into equal files horizonta
>lly AND vertically say about 65 characters long and 80 wide. I tried to
>look for an obvious way to do this but can only divide it into horizonta
>l portions with split.
To do it vertically, use cut -c:
while [ $START -le $MAXLENGTH ]
END=`expr $START + $WIDTH - 1`
cut -c$START-$END <$FILE >$outf
START=`expr $START + $WIDTH`
Vote against SPAM: http://www.politik-digital.de/spam/
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
"But God said to him, You fool! This very night your
soul is required of you; and now who will own what you
have prepared? So is the man who lays up treasure for
himself, and is not rich toward God."