Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 1998 23:10:35 -0300 (ADT)
From:      Michael Richards <miker@scifair.acadiau.ca>
To:        Sue Blake <sue@welearn.com.au>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: what to learn?
Message-ID:  <Pine.BSF.3.96.980614230123.8523A-100000@scifair.acadiau.ca>
In-Reply-To: <19980615085554.56310@welearn.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 15 Jun 1998, Sue Blake wrote:

> I have a large text file (2-3 megs) with numbers at the beginning of lines.
> Currently I'm reading through this file, checking that the numbers go in
> sequence, detecting errors but not fixing. This file has a long history of
> cutting and pasting without always updating the codes properly :-(
So does this mean you want only to know where the errors lie, or you want
to fix it? My first approach would be simply to pipe it through sort. I
have been known to do all kinds of wierd stuff with awk, and cut.

> ST71d-3.1
> ST71d-3.2
> ST71d-3.4   # whoops

I am not 100% clear on what you want to do, but a perl script may be
easier than streams of text processors all iped together.

You could (in perl)
load the file into an array.
call sort to order it
then mess with splitting the - number part off to make sure they don't
skip any.

Assuming of course this is what you wanted to do. There are a number of
ways to attack this...

-Mike



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980614230123.8523A-100000>