www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  DB/Textworks    Deleting duplicate entries in a field
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Posted
Hello! We have a "subjects" field in one of our textbases, and recently I've been coming across a lot of records that have the same subject term entered more than once into the field for a record. For example, the list of entries in "Subjects" for a record might be: Smoking, Women, Pharmacotherapy, Smoking. And I'd like to be able to find the records that have duplicate terms and then remove the duplicate (or, alternatively, remove both instances of the term and then put one back).

I found an old post on the forums asking this same question from 2001 (http://inmagic.infopop.cc/eve/forums/a/tpc/f/787608632/m/335103842?r=335103842#335103842), and wondered if this feature has been added to InMagic yet, or if there is an easier way to solve the problem six years later? If I could somehow just find all the records that, say, have the word "Smoking" applied twice in the subjects field, then I could use Batch Modify to erase all copies of the term from the field, and then use Batch Mod again to put one copy back. But it's finding the records with the duplicates that has me stymied.

The 2001 post suggested a solution, but it appears to involve exporting the entire textbase to text, tinkering with the file, and then putting the records back. Our database is huge (over 70,000 records!), so I'm really hoping InMagic has come up with a better solution than that by now? If not, please add me to the list requesting this feature, because it seems like something that would be a fairly common problem.

Thanks for any information or advice you can offer!

--Meg Brunner


Alcohol & Drug Abuse Institute
University of Washington
 
Posts: 88 | Location: Seattle, WA | Registered: Wed April 02 2003Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
I'm working on the same issue - I've got a (found) script that I modified to find duplicates in field 'AA' and delete them:

function_onSave()
{
var temp = Form.boxes("AA").content;
var array2 = temp.split(Application.entrySeparator) ;
var array1= new Array;
for(var i = 0; i < array2.length; i++)
{
var xx = true;
var ArrayVal = array2[i];
for(var j = i+1; j < array2.length; j++)
{
if(array2[j] == ArrayVal)
xx = false;
if(xx == true)
array1.push(ArrayVal)
}
Form.boxes("AA").content = array1;
}

The problem I'm having is that it returns the array as a string with the entries separated by commas instead of entry separators - fine if you can then do a replace but hard if, like me, your original contents contained commas.

And now that I think about it, probably not so useful for going through a whole textbase, unless you want to open and save every record... Yeah, hopefully someone has a brighter idea?

Brent
 
Posts: 21 | Location: Wellington, New Zealand | Registered: Tue July 29 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  DB/Textworks    Deleting duplicate entries in a field