Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 1998 22:42:49 -0400
From:      Dan Welch <WELCHDW@truth.wofford.edu>
To:        sue@welearn.com.au
Cc:        QUESTIONS@FreeBSD.ORG, WELCHDW@truth.wofford.edu
Subject:   RE: what to learn?
Message-ID:  <980614224249.20a0b063@mail.wofford.edu>

next in thread | raw e-mail | index | archive | help
>> I have a large text file (2-3 megs) with numbers at the beginning of
l> 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 :-( 
>
> Surely there's a better way, a good incentive for a bit of learning
> with a practical application. I dabbled with perl a tiny bit a long
> time ago and could relearn but maybe there's another tool that's
> more appropriate? 

Regular expressions make this task relatively easy.  Perl has that 
in abundance, as do sed, awk, and other tools that predate perl.

My strong opinion is that the best way to learn what you need would 
be to work through the tutorial at the beginning of THE AWK 
PROGRAMMING LANGUAGE bootk by Aho, Kernighan, and Weinberger.  The 
book is a series of extremely practical serious problem solving 
examples for just such problems as you describe here.  While there 
are very good books for the other tools, this one makes awk 
exceptionally valuable and effective.

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?980614224249.20a0b063>