Newbies cbx11 Posted December 13, 2001 Newbies Posted December 13, 2001 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.
tlsparker Posted December 13, 2001 Posted December 13, 2001 "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
per Posted December 23, 2001 Posted December 23, 2001 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
bobsmith Posted December 24, 2001 Posted December 24, 2001 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" 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
Newbies tsanfilippo Posted January 8, 2002 Newbies Posted January 8, 2002 I am using FM 5.0 V3 and can not seem to duplicate this script? First off the Perform Find does not allow me to enter anything after it? Where you say to add [ Request 1: ipAddress ! ] after Perform find? Where am I going wrong?
spb Posted January 9, 2002 Posted January 9, 2002 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
Recommended Posts
This topic is 8359 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 accountSign in
Already have an account? Sign in here.
Sign In Now