From owner-freebsd-questions@FreeBSD.ORG Thu Jul 14 17:48:05 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 A8FC616A41F for ; Thu, 14 Jul 2005 17:48:05 +0000 (GMT) (envelope-from dan@malaby.com) Received: from mail.uemsvc.net (bl.metron.com [192.160.193.107]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EF7A43D46 for ; Thu, 14 Jul 2005 17:48:02 +0000 (GMT) (envelope-from dan@malaby.com) Received: from [192.168.18.10] (tc-88.eugene.epud.net [12.108.30.88]) (authenticated bits=0) by mail.uemsvc.net (8.13.4/8.12.6) with ESMTP id j6EHlpNS002362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jul 2005 10:47:55 -0700 (PDT) (envelope-from dan@malaby.com) Message-ID: <42D6A546.6030308@malaby.com> Date: Thu, 14 Jul 2005 10:47:50 -0700 From: Daniel Malaby User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nelis Lamprecht References: <42D5C3FF.8070004@malaby.com> <7cbadc87050714023654bd3f26@mail.gmail.com> <7cbadc8705071402394bfd087b@mail.gmail.com> In-Reply-To: <7cbadc8705071402394bfd087b@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------040806090107080204000705" Cc: freebsd-questions@freebsd.org Subject: Re: using -t option with unix sort ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dan@malaby.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2005 17:48:05 -0000 This is a multi-part message in MIME format. --------------040806090107080204000705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Nelis Lamprecht wrote: > On 7/14/05, Nelis Lamprecht wrote: > >>On 7/14/05, Daniel Malaby wrote: >> >>>Hi All, >>> >>>I am trying to sort a tab delimited file with sort. The problem I am >>>having is with the -t option. I do not know how to pass a tab. >> >> >> >>>sort -t \t >> >> >> >>>Any suggestions would be much appreciated. >> >>remove the space between -t and \t and it should work > > > actually scratch that, it works either way. can you give a sample of the data ? > > Regards, > Nelis The sample data has 9 fields, I am trying to sort on the fifth field, here is what I have tried. sort -t\t +4 -5 -o test.txt sample.txt I did try removing the space and it did not work, I have also tried removing the -5. I think the spaces in the third field are confusing sort. BTW this is being done on a PC running FBSD 4.11 prerelease #1 Thanks for your help and suggestions. --------------040806090107080204000705 Content-Type: text/plain; name="sample.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sample.txt" E002 19085 GENERAL DYNAMICS 5031802 E-GL/VX/B/R1.0 SFT CD, GL VXWORKS BOREALIS R1.0 06/30/05 1 $995.00 $995.00 E016 19096 TGA INGENIERIA Y ELECTRONICS S 5881-2 E-AD600729C501 ARGUS PMC,2 DVI 16MB PERCHAN USB A/V 12/01/05 30 $2,312.00 $69,360.00 E016 19096 TGA INGENIERIA Y ELECTRONICS S 5881-2 E-DDX/SO/R4.0 SFT CD, DDX SOL 2.6-9 BOREALIS R4.0 12/01/05 30 $74.00 $2,220.00 E016 19096 TGA INGENIERIA Y ELECTRONICS S 5881-2 E-VIN/SO/R1.0 SFT CD, VID CAP SOL 2.6-9 BOREALIS R1.0 12/01/05 30 $74.00 $2,220.00 E021 19093 GANYMED COMPUTER GMBH 7103879 E-AD90073913011 GARNET PMC RIO8 C2, REAR I/O 16MB 07/19/05 2 $1,848.00 $3,696.00 E024 19080 DRS LAUREL TECHNOLOGIES 94358 E-AC7007121115A ECLIPSE3 PMC, VGA 16MB Q70 08/18/05 1 $846.00 $846.00 E024 19080 DRS LAUREL TECHNOLOGIES 94358 E-AC7007121115A ECLIPSE3 PMC, VGA 16MB Q70 10/19/05 19 $846.00 $16,074.00 E024 19080 DRS LAUREL TECHNOLOGIES 94358 E-AC7007121115A ECLIPSE3 PMC, VGA 16MB Q70 09/20/05 2 $846.00 $1,692.00 E024 19080 DRS LAUREL TECHNOLOGIES 94358 E-AC7007121115A ECLIPSE3 PMC, VGA 16MB Q70 11/17/05 7 $846.00 $5,922.00 --------------040806090107080204000705--