BrizUK Posted June 22, 2005 Posted June 22, 2005 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?
aaa Posted June 22, 2005 Posted June 22, 2005 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.
-Queue- Posted June 22, 2005 Posted June 22, 2005 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.
BrizUK Posted June 23, 2005 Author Posted June 23, 2005 Thanks for this suggestion which didn't quite work. However a later post changed the scripting which does the job.
BrizUK Posted June 23, 2005 Author Posted June 23, 2005 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.
Recommended Posts
This topic is 7097 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