|
Re: Primary Key Hash help: msg#01078lang.ruby.general
On Mon, Aug 12, 2002 at 11:41:29PM +0900, Chris Morris wrote: > I have a huge data file with rows like this: > > AL Prattville 36066 01001 US 01-001-0870 01 001 1 3 0162328 1 > AL Prattville 36067 01001 US 01-001-0870 01 001 1 3 0162328 1 > AL Prattville 36068 01001 US 01-001-0870 01 001 1 3 0162328 1 > > The unique key for each row is all columns. I'd like to generate a single > column unique key that's derived from all the data, so a simple sequential > number primary key won't do. Any tips on how I could do this in Ruby? Make a hash sum over the data: require 'md5' unique_key = MD5.new(line) -billy. -- Meisterbohne Söflinger Straße 100 Tel: +49-731-399 499-0 eLösungen 89077 Ulm Fax: +49-731-399 499-9
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Choosing ruby?, Gavin Sinclair |
|---|---|
| Next by Date: | Re: Primary Key Hash help, angus |
| Previous by Thread: | Primary Key Hash help, Chris Morris |
| Next by Thread: | Re: Primary Key Hash help, Chris Morris |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |