help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I this efficiently? common rows in two data sets


From: Mike Miller
Subject: Re: How can I this efficiently? common rows in two data sets
Date: Thu, 12 May 2005 20:50:35 -0500 (CDT)

On Thu, 12 May 2005, Rick Niles wrote:

It was a bit more complicated because the files contained different kinds of data, so I had to put them in a matrix together with a "key" column so I could be sure I could separate them out afterward, but your suggestion did the trick, now it's super fast!

Note to self: Turn everything into a sort and it will go nice and fast. (hmm, what is the philosophical means of this?)


In the unix world it's...

cat files* | sort | uniq

but that only works if you don't care about the order of the lines.

In Octave, I learned recently that there is a "unique" function (in Octaveforge, I believe) written by Paul Kienzle, but I'm not sure if it does the same thing is unix uniq.

If you look at our archives from August 27, 2004, and September 1, 2004 for posts with the Subject containing "uniq -c", you'll find some more info about this kind of thing.

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]