Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!roger From: roger@batcomputer.tn.cornell.edu (Roger Boissonnas) Newsgroups: comp.databases Subject: Re: Deleting duplicate records Keywords: unique key, deleteing duplicate records Message-ID: <8436@batcomputer.tn.cornell.edu> Date: 18 Jul 89 11:35:48 GMT References: <1989Jul17.165249.26554@xenitec.uucp> Reply-To: roger@tcgould.tn.cornell.edu (Roger Boissonnas) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 63 In article <1989Jul17.165249.26554@xenitec.uucp> timk@egvideo.UUCP (Tim Kuehn) writes: >englandr@phoenix.Princeton.EDU (Scott Englander) writes: >>I'd like to delete duplicate records in a FoxBase file. > >... Previous attempt deleted ... > >Program: >-------- >use dborig >copy structure to dbuniq >select 0 >use dbunique >select dborig >index on to ndxuniq unique >set index to ndxuniq >go top >do while .not. eof() > select dbuniq > append blank > replace dbuniq->field1 with dborig->field1,; > dbuniq->field2 with dborig->field2,; > dbuniq->field3 with dborig->field3,; > dbuniq->field4 with dborig->field4 > > <...etc...> > select dborig > skip >enddo You can write a program to do the same thing in only three lines: USE dborig INDEX ON TO ndxuniq UNIQUE COPY TO dbuniq Roger Boissonnas roger@tcgould.tn.cornell.edu Cornell Theory Center (607) 255-8306 Roger Boissonnas roger@tcgould.tn.cornell.edu Cornell Theory Center (607) 255-8306