From owner-freebsd-questions Sun Jun 14 19:43:47 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA22702 for freebsd-questions-outgoing; Sun, 14 Jun 1998 19:43:47 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from TRUTH.WOFFORD.EDU (truth.wofford.edu [199.190.174.30]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id TAA22556 for ; Sun, 14 Jun 1998 19:43:05 -0700 (PDT) (envelope-from WELCHDW@TRUTH.WOFFORD.EDU) Received: by TRUTH.WOFFORD.EDU; Sun, 14 Jun 1998 22:42:49 -0400 Date: Sun, 14 Jun 1998 22:42:49 -0400 From: Dan Welch To: sue@welearn.com.au CC: QUESTIONS@FreeBSD.ORG, WELCHDW@truth.wofford.edu Message-Id: <980614224249.20a0b063@mail.wofford.edu> Subject: RE: what to learn? Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> 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