Jump to content

How to delete duplicate records?


This topic is 7224 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I have a data base that I imported, that has many of the same record.

All the records are IP address,(65.112.149.100) I want to delete the duplicates.

How do I do it?

Thank you for any help that you can give.

Link to comment
Share on other sites

"I have a data base that I imported, that has many of the same record.

All the records are IP address,(65.112.149.100) I want to delete the duplicates.

How do I do it?"

Enter find mode, type the value in the appropriate field (IP address?, then Perform Find. You now have a found set of all the duplicates.

Under records menu, Omit Record (removes one of the records from your found set). Then Delete all. This sequence deletes all but one duplicate.

If you have multiple sets of duplicates, automate the above process in a script. Do this by Looping through all the records, finding all records with a particular value, omitting one of the records, then deleting the rest. If a record has no duplicates, you will not delete the record because it will be omitted.

If you need help with the script syntax, give a yell.

Tom Parker

[email protected]

http://www.tgparker.com/filemaker

Link to comment
Share on other sites

  • 2 weeks later...

Hi there,

Here is a script which solve your problems, if I have understand your question right:

Make a global field "Search 2".

Make a calculation text field called "Search". Put your main fields in this field.

Make a script:

Show all records

Sort (Search-field A-Z)

Go to first record

Loop

Set "Search" to "Search 2"

Go to Next record. Exit after all.

If(Search = Search 2)

Delete or Omit if you want keep the records

Else

Set "Search" to "Search 2"

End If

End Loop

Good luck!

-Per

Link to comment
Share on other sites

Here is a script I use to delete duplicates. It works with one duplicate or several duplicates of one record. REMEMBER..make a backup copy prior to running this script. (I have used the field that has duplicates as "ipAddress" shocked.gif" border="0

Enter Find Mode []

[]

Perform Find [ Request 1: ipAddress ! ]

[ Restore find requests ]

Sort [ Sort Order: ipAddress (Ascending) ]

[ Restore sort order, No dialog ]

Go to Record/Request/Page

[ First ]

Set Field [ g_DupRecords, ipAddress ]

Omit Record

Loop

If [ ipAddress = g_DupRecords ]

Delete Record/Request

[ No dialog ]

Else

Set Field [ g_DupRecords, ipAddress ]

Omit Record

End If

Exit Loop If [ Status( CurrentFoundCount) = 0 ]

End Loop

Link to comment
Share on other sites

  • 2 weeks later...

The [ Request 1: ipAddress ! ] after the Perform Find commands represents a Find that was previously memorized. You could do this Find manually (outside of your script) first, then open your script in Scriptmaker. When you close the script, you'll get a box asking if you want to keep or replace find requests. Click "replace" and the script will remember your find request.

But a better way would be to build your find request into the script. In your example, right after the "Enter Find Mode" step, put a step that says:

Set Field [ipAdress, "!"]

Then the Perform Find step will run that as a request.

Steve Brown

Link to comment
Share on other sites

This topic is 7224 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.