Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting Duplicate Records
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00089997
Message ID:
00090001
Views:
30
Derek,

The only thing I can think of is that you haven't sorted or ordered the table and that most of the records in the table are in order by part number, but a few are out of order. Try creating a tag on part number and setting the order to this tag before your DO WHILE !EOF().

>I have a file which is derived from another file 99% of whose records
>were imported from an outside database of part numbers. Of 137000
>records about 500 are duplicates as many as 18 on a single number.
>I wrote the code below to remove the duplicates and it works where
>there are up to 3 duplicates but on the record with larger numbers
>jof dupllicates it will delete say 13 of 15 leaving the 2 identical records
>in the beginning of the duplication. Help.
>
>use d:\stock\stock1.dbf
>do while .not. eof()
>m.check1 =number
>skip 1
>m.check2 = number
>do case
>case m.check1 = m.check2
>delete
>case m.check1 # m.check2
>skip 1
>endcase
>
>enddo
>pack
Previous
Reply
Map
View

Click here to load this message in the networking platform