From owner-freebsd-questions Thu Sep 19 15:20:33 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17A6E37B401 for ; Thu, 19 Sep 2002 15:20:31 -0700 (PDT) Received: from smtp.accelernet.net (smtp.accelernet.net [208.159.164.209]) by mx1.FreeBSD.org (Postfix) with SMTP id 47D0943E65 for ; Thu, 19 Sep 2002 15:20:29 -0700 (PDT) (envelope-from matt@championelevators.com) Received: (qmail 53318 invoked from network); 19 Sep 2002 22:20:28 -0000 Received: from 208-169-162-132.hou.accelernet.net (HELO daemon.championelevators.com) (208.169.162.132) by smtp.accelernet.net with SMTP; 19 Sep 2002 22:20:28 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Matthew Bettinger Reply-To: mbettinger@championelevators.com Organization: Champion Elevators, inc. To: freebsd-questions@FreeBSD.ORG, mbettinger@championelevators.com Subject: Re: OT sed help Date: Thu, 19 Sep 2002 17:19:22 -0500 User-Agent: KMail/1.4.2 References: <200209191940.g8JJeUGu069968@lurza.secnetix.de> In-Reply-To: <200209191940.g8JJeUGu069968@lurza.secnetix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200209191719.28643.matt@championelevators.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks for the solution. Informix fun fun ... Matt On Thursday 19 September 2002 02:40 pm, Oliver Fromme wrote: > Matthew Bettinger 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 f= irst > > 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9ik1vXG7+MmNwciURAtgqAKCkcmKuBbKcVAy8T4kydXbQPuA7WQCcC27c pCpQllkmCZp0aIIhiWqE7lo=3D =3Dl7D5 -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message