June 22, 200520 yr I have been given a database of several thousand records. The records consist of only one field which holds a UK town name. There are a considerable number of names, probably also serveral thousand, which are shown by a brief check of the database. These duplicates have been produced by error or because there are towns with the same name anyway. I need to identify and delete any duplicates which exist. Have tried Find with ! in the search field but this identifies all duplicates including, as it were the 'original' entry. What I need to do is to leave one record of any particular name but identify and delete any other records which have the same name. I have looked at self-joining which seemed to offer a possible solution but to no avail. Can anyone give me any clues?
June 22, 200520 yr Sort your records by name and create script like this: Sort Go To Record First Set Field[Any_Global_Field,Name} Loop Go To Record Request Next(exit after last) IF Name=Any_Global_Field,Name Delete Record Go To Previosus record Endif Endloop Other way is to export your records to other file using "summary by name" option, then delete all records then import from exported file.
June 22, 200520 yr Almost. Sort Go To Record/Request/Page [First] Set Field[Any_Global_Field, ""] Loop If [Name <> Any_Global_Field] Set Field [Any_Global_Field, Name] Go To Record/Request/Page [Next, Exit after last] Else Delete Record/Request [No dialog] End If End Loop You could do a ! search initially, to limit the found set and speed the process.
June 23, 200520 yr Author Thanks for this suggestion which didn't quite work. However a later post changed the scripting which does the job.
June 23, 200520 yr Author Thanks a million, the script does the job. Scripting in FMPro is not one of my strong points as I don't need it very often, so I doubt I would have got the solution otherwise.
Create an account or sign in to comment