Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Sep 2002 21:40:30 +0200 (CEST)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-questions@FreeBSD.ORG, mbettinger@championelevators.com
Subject:   Re: OT sed help
Message-ID:  <200209191940.g8JJeUGu069968@lurza.secnetix.de>
In-Reply-To: <200209190938.35632.matt@championelevators.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Bettinger <matt@championelevators.com> wrote:
 > I have a flat file that I need to import into a database.  The first field of 
 > the file is a part number which cannot exceed more than 8 characters.
 > 
 > Does anyone know how I can use  sed to count the characters in the first field 
 > and if there are more than 8 print out a list?

It's probably easiest to use awk for that job:

   awk '(length($1) > 8)' flatfile.txt

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

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?200209191940.g8JJeUGu069968>