[expert] Who Broke Sort?
Ok, it's been a long time since I've needed to do this, and maybe I just forgot how. But: To sort out duplicate lines in a text file, didn't "sort -u" do the trick? Or am I getting fuzzy & old? I have a large text file that I receive on a regular basis ( a couple times a week). I need to clean it up for import into a database. I'm stuck on getting duplicate lines out. I swear, I just used to use "sort -n", but that isn't working now. Can someone shed a little light on how to do this? Thanks in advance Ric Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] Who Broke Sort?
On Thu, Sep 05, 2002 at 18:50 -0400, Ric Tibbetts wrote: > Ok, it's been a long time since I've needed to do this, and maybe I just > forgot how. > > But: > > To sort out duplicate lines in a text file, didn't "sort -u" do the > trick? Or am I getting fuzzy & old? > > I have a large text file that I receive on a regular basis ( a couple > times a week). I need to clean it up for import into a database. I'm > stuck on getting duplicate lines out. I swear, I just used to use "sort > -n", but that isn't working now. > > Can someone shed a little light on how to do this? man sort says that '-n' works in check mode which has to be activated by a leading '-c'. I never used sort and I only have the german man page. so you want to check man sort yourself to be sure. wobo -- "... and anyway, an html can't carry a virus." (Aug 2001, Usenet) --- [EMAIL PROTECTED] ICQ: #128612867 GPG-ID: A69882EE --- ISDN4LINUX-FAQ -- Deutsch: http://www.wolf-b.de/i4l/i4lfaq-de.html Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] Who Broke Sort?
At 06:50 PM 9/5/02, Ric Tibbetts wrote: >Ok, it's been a long time since I've needed to do this, and maybe I just >forgot how. > >But: > >To sort out duplicate lines in a text file, didn't "sort -u" do the >trick? Or am I getting fuzzy & old? > >I have a large text file that I receive on a regular basis ( a couple >times a week). I need to clean it up for import into a database. I'm >stuck on getting duplicate lines out. I swear, I just used to use "sort >-n", but that isn't working now. > >Can someone shed a little light on how to do this? > >Thanks in advance > > Ric "man sort" will show you what the "-n" option does. To remove duplicates, you can do "sort out.file" or "sort -u out.file". Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] Who Broke Sort?
On Thu, 2002-09-05 at 19:06, David Relson wrote: > At 06:50 PM 9/5/02, Ric Tibbetts wrote: > >Ok, it's been a long time since I've needed to do this, and maybe I just > >forgot how. > > > >But: > > > >To sort out duplicate lines in a text file, didn't "sort -u" do the > >trick? Or am I getting fuzzy & old? > > > >I have a large text file that I receive on a regular basis ( a couple > >times a week). I need to clean it up for import into a database. I'm > >stuck on getting duplicate lines out. I swear, I just used to use "sort > >-n", but that isn't working now. > > > >Can someone shed a little light on how to do this? > > > >Thanks in advance > > > > Ric > > "man sort" will show you what the "-n" option does. > > To remove duplicates, you can do "sort out.file" or "sort > -u out.file". Yep, exactly as I remembered it. But -u didn't seem to be working. It turned out to be a "very" minor difference in the lines, in a very large file. The first two places I looked were "man sort", and "info sort". Both said that -u should work. I suspect that it does. The fault may have been mine on this one. Thanks! Ric Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com