Question: Deleting duplicates (x 2)

Love the iWork 09 upgrade, but didn't see the answer to this in the manual. In Excel, you can find duplicates and essentially delete them by using Advanced Filter to only show unique records. Can you do the same thing in Numbers 09?
To be specific, there are two types of things I want to be able to do:
1. Convert a column that includes A,B,B,C,D,D,D,E to simply A,B,C,D,E
2. Convert a column that includes A,B,B,C,D,D,D,E to simply A,C,E
I'm not very good with formulas, so if anybody has a suggestion on how to do either or both of those, it would be really.

I just discovered that the OP was not wanting a way to filter on rows but wanted two ways to filter.
It's what this new script offers.
--[SCRIPT filter on column]
Enregistrer le script en tant qu'Application ou Progiciel : filter on column.app
déplacer l'application créée dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Sélectionnez une cellule de la colonne à prendre en compte.
menu Scripts > Numbers > filter on column
Vous pouvez choisir de
• conserver un élément de chaque groupe de doublons
• supprimer tous les éléments de chaque groupe de doublons.
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
+++++++
Save the script as an Application or an Application Bundle: filter on column.app
Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Select a cell in the column to scan.
menu Scripts > Numbers > filter on column
You may choose to
• keep one item of each group of duplicates
• remove every items of each group of duplicates.
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
Based on a jaxjason's script
Yvan KOENIG (Vallauris FRANCE)
30 janvier 2009
--=====
property theApp : "Numbers"
(* A property useful to fasten the use of list *)
property theKeys : {}
--=====
on run
my nettoie()
if my parleFrancais() then
set keep_one to "En garder un"
set keepOne to display dialog "Que faire des doublons ?" buttons {"Annuler", "Les supprimer", keep_one} default button keep_one
else
set keep_one to "Keep one"
set keepOne to display dialog "What to do with duplicates ?" buttons {"Cancel", "Hide all", keep_one} default button keep_one
end if
set keepOne to button returned of keepOne is keep_one
set {current_Range, current_table, current_Sheet, current_Doc} to my getSelection()
if my parleFrancais() then
if current_Range is missing value then error "Aucune feuille ne contient une table sélectionnée."
else
if current_Range is missing value then error "No sheet has a selected table."
end if
set twoNames to my decoupe(current_Range, ":")
set {colNum1, rowNum1} to my decipher(item 1 of twoNames)
tell application "Numbers"
tell document current_Doc to tell sheet current_Sheet to tell table current_table to tell column colNum1
set cor to count of rows
if keepOne then (*
Here we keep one item of every group of duplicates *)
repeat with j from cor to 1 by -1
set m to value of cell j
if m is in my theKeys then
remove row j
else
copy m to end of my theKeys
end if
end repeat -- j
else (*
Here we remove every items of each group of duplicates *)
set {bef, aft} to {"@$¥", "¥$@"} (*
With such separators, we may be sure that there will not be a wrong check upon availability *)
repeat with j from 1 to cor
copy bef & value of cell j & aft to end of my theKeys
end repeat -- j
Here we know that text item delimiters where set to "" by the decoupe() handler *)
set theKeys to my theKeys as text (*
the use of 'my' is required to fasten the use of lists but is useless for text items ! *)
repeat with i from cor to 1 by -1 (*
As we scan the table backwards (starting from the bottom row),
we may remove a row immediately when I discover that it is a duplicate *)
if (count of my decoupe(theKeys, bef & value of cell i & aft)) > 2 then remove row i
end repeat -- i
end if -- keepOne
end tell -- column of table of sheet of document
end tell -- application
my nettoie()
end run
--=====
on getSelection()
local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
tell application "Numbers" to tell document 1
repeat with i from 1 to the count of sheets
tell sheet i
set x to the count of tables
if x > 0 then
repeat with y from 1 to x
(* Open a trap to catch the selection range.
The structure of this item
«class » "A2:M25" of table "Tableau 1" of sheet "Feuille 1" of document "Sans titre"
can't be coerced as text.
So, when the instruction (selection range of table y) as text
receive 'missing value' it behaves correctly and the lup continue.
But, when it receive THE true selection range, it generates an error
whose message is errMsg and number is errNum.
We grab them just after the on error instruction *)
try
(selection range of table y) as text
on error errMsg number errNum (*
As we reached THE selection range, we are here.
We grab the errMsg here. In French it looks like:
Impossible de transformer «class » "A2:M25" of «class NmTb» "Tableau 1" of «class NmSh» "Feuille 1" of document "Sans titre" of application "Numbers" en type string.
The handler cuts it in pieces using quotes as delimiters.
item 1 (_) "Impossible de transformer «class » "
item 2 (theRange) "A2:M25"
item 3 (_) " of «class NmTb» "
item 4 (theTable) "Tableau 1"
item 5 (_) " of «class NmSh» "
item 6 (theSheet) "Feuille 1"
item 7 (_) " of document "
item 8 (theDoc) "Sans titre"
item 9 ( I drop it ) " of application "
item 10 ( I drop it ) "Numbers"
item 11 (I drop it ) " en type string."
I grab these items in the list
{_, theRange, _, theTable, _, theSheet, _, theDoc}
Yes, underscore is a valid name of variable.
I often uses it when I want to drop something.
An alternate way would be to code:
set ll to my decoupe(errMsg, quote)
set theRange to item 2 of ll
set theTable to item 4 of ll
set theSheet to item 8 of ll
set theDoc to item 10 of ll
it works exactly the same but it's not so elegant.
set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
return {theRange, theTable, theSheet, theDoc} (*
as we grabbed the interesting datas, we exit sending them to caller *)
end try
end repeat -- y
end if -- x>0
end tell -- sheet
end repeat -- i
end tell -- document
return {missing value, missing value, missing value, missing value}
end getSelection
--=====
on decipher(n)
local colNum, rowNum, letters
set letters to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if (character 2 of n) as text > "9" then
set colNum to (offset of (character 1 of n) in letters) * 64 + (offset of (character 2 of n) in letters)
set rowNum to (text 3 thru -1 of n) as integer
else
set colNum to offset of (character 1 of n) in letters
set rowNum to (text 2 thru -1 of n) as integer
end if
return {colNum, rowNum}
end decipher
--=====
on decoupe(t, d)
local l
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to ""
return l
end decoupe
--=====
on parleFrancais()
local z
try
tell application theApp to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z = "Annuler")
end parleFrancais
--=====
on nettoie()
(* no need to store these lists in the script forever *)
set theKeys to {}
end nettoie
--=====
--[/SCRIPT]
Yvan KOENIG (from FRANCE vendredi 30 janvier 2009 16:18:49)

Similar Messages

  • Deleting duplicate rows based on three columns in Oracle 8i

    Hi all,
    The database we use is Oracle 8i.
    The query below raises the too_many_rows exception when I launch an application. So I want to delete the duplicated rows :
    select polarisation_1, polarisation_2
    into v_pol1_tech, v_pol2_tech
    from v_cfh_lien_element
    where nom_lien = p_nom_lien
    AND num_canal_1 = p_num_canal_1
    AND freq_emise_1 = p_freq_emise_1;
    Notice that with many possible values of the parameters p_nom_lien, p_num_canal_1 and p_freq_emise_1 then the exception is raised.
    So how to delete generally the duplicated rows based on the three columns "nom_lien" , "num_canal_1" and "freq_emise_1" ?
    Thank you very much indeed.

    Check the other thread with same question deleting duplicate rows based on three columns in Oracle 8i

  • Hello, Is there an easy way of understanding what menu language means before you press the button, for instance, DUPLICATE, does it mean delete duplicates or form them? Cyfrommayo

    Is there an easy way of understanding what to expect when I press something like DUPLICATE?
    Cyfrommayo

    Thanks Guys,
    Yes, SAVE AS makes sense now you have illustrated it. Would an opportunity to rename the copy file have been a good idea? Additionally, a place to save the copy, something like the old PC way?
    I got to this question, because of another incident which ended up with many duplicates, the help files did not know what the question DELETE DUPLICATE was? I have therefore ended up deleting individual duplicate files as a 'work around'. The learning curve hey.
    Regards,
    Cyfrommayo

  • How can i delete duplicates from my itunes account?

    At "View" I chose "Show duplicates."
    Now what do I do to delete duplicates quickly without having to delete each one separately?
    THanks

    Hello, singinheart. 
    Thank you for the question.  Since you have already identified the duplicate media you just have a couple more steps to go.  This article outlines the remainder of the steps in order to mass delete the duplicates. 
    How to find and remove duplicate items in your iTunes library
    http://support.apple.com/kb/ht2905
    Cheers,
    Jason H. 

  • How do I delete duplicate songs from my library that have been automaticly downloaded from itunes?

    How do you delete duplicate songs from an iphone 3gs?  I did the automaticly download song feature when doawloading from my CPU and now there are 11 songs that no matter what I do will not come off my phone.  I have tried everything.  Also how do you shut off this automatic download feature?

    Hello momoandfam,
    Welcome to Apple Support Communities.
    Take a look at the article linked below, it’ll answer your questions about finding and deleting duplicate tracks in your iTunes library.
    Find and remove duplicate items in your iTunes library - Apple Support
    Take care,
    -Jason

  • HOW TO DELETE DUPLICATE ELEMENT IN A VECTOR

    Hi everybody!
    If I've a vector like this vectA={apple,orange,grape,apple,apple,banana}
    and I want final result be vectB={apple,orange,grape,banana}.
    How should I compare each element in vectA and delete duplicate element. Like here duplicated element is apple. Only one apple remain in the vectB.
    Any help,
    Thanks.

    Hello all. Good question and good answers, but I would like to elaborate.
    To begin with, you specifically asked to map the following:
    {apple,orange,grape,apple,apple,banana} ==> {apple,orange,grape,banana}
    Both of cotton.m's solutions do NOT do this, unfortunately. They are both useful in particular cases though, so think about what you're trying to do:
    cotton.m's first solution is best if order does not matter. In fact, as flounder first stated, whenever order doesn't matter, your most efficient bet is to use a Set instead of a List (or Vector) anyways.
    Set vectB = new HashSet(vectA);This code maps to {banana, orange, grape, apple}, because HashSets are "randomly" ordered.
    cotton.m's second solution is good if you want to impose NEW ordering on the List.
    Set vectB = new TreeSet(vectA);This code maps to {apple, banana, grape, orange}, because TreeSet uses alphabetical-order on Strings by default.
    java_2006, your solution is the most correct, but it's a little verbose for my taste :)
    more importantly, the runtime-efficiency is pretty bad (n-squared). calling Vector.contains performs (at worst) n comparisons; you're going to call it n times! Set.contains usually performs 2 comparisons (constant, much better), so I suggest you USE a Set to do the filtering, while still sticking with your good idea to use a List. When the ordering is "arbitrary" (so can't use TreeSet) but still relevant (so can't use HashSet), you're basically talking about a List.
    I think saving A LOT of time is worth using A LITTLE extra space, so here, let's save ourself some runtime, and some carpal-tunnel.
    import java.util.*;
    class Foo {
         public static void main(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List     l = Arrays.asList(fruits),
                   m = filterDups(l);
              System.out.println(m);
         // remember, both of the following methods use O(n) space, but only O(n) time
         static List filterDups(List l) {
              List retVal = new ArrayList();
              Set s = new HashSet();
              for (Object o : l)
                   if (s.add(o))
                        retVal.add(o);     // Set.add returns true iff the item was NOT already present
              return retVal;
         static void killDups(List l) {
              Set s = new HashSet();
              for (Iterator i = l.iterator(); i.hasNext(); )
                   if (! s.add(i.next()))     
                        i.remove();
         // honestly, please don't use Vectors ever again... thanks!
         // if you're going to be a jerk about it, and claim you NEED a Vector result
         // then here's your code, whiner
         public static void mainx(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List l = Arrays.asList(fruits);
              Vector v = new Vector(l);
              killDups(v);
              System.out.println(v);
    }

  • Deleting Duplicates from a table

    Its a huge table with 52 fields and 30k rows. I need to delete the duplicates based on one of the fields. GROUP BY is taking a lot of time. Is there a quicker way to delete the duplicates using SQL.
    Thanks.

    How many duplicates have you got? Do you have even a vague idea? 1%? 20%? 90%?
    One way would be to add a unique constraint on the column in question. This will fail, of course, but you can use the EXCEPTIONS INTO clause to find all the ROWIDs which have duplicate values. You can then choose to delete those rows using a variant on teh query already posted. You may need to run %ORACLE_HOME%\rdbms\admin\utlexcptn.sql to build the EXCEPTIONS table first.
    This may seem like some unnecessary work, but the most effective way of deleting duplicates from a table is to have relational integrity constraints in place which prevent you having duplicates in the first place. To paraphrase Tim Gorman, you can't get faster than zero work!
    Cheers, APC

  • Is it safe to delete duplicate e-mail accounts on iPhone?

    Downloaded new iTunes update 4.3.5 to my iMac OS 10.6.8.  Then did a sync to my iPhone 4.   Now the Mailbox on my iPhone 4 reflects the Yahoo account it has always reflected but now two duplicate sbcglobal accounts have also appeared.  Is it safe to delete the two duplicate sbcglobal accounts?   Many previously deleted e-mails have also reappeared. 

    I am new to this community so I may be doing something wrong...since it has been almost 3 hours and I've not received any replies regarding my question about duplicate e-mail accounts.  Or is it just that no one has an answer for me? 
    I've read lots of replies regarding the error to the download 4.3.5 but none of them were my issue.  Thanks for anyone's help!

  • Delete duplicate rows -- based on 4 columns -- how?

    I asked this question on how to delete duplicates recently and received this suggestion which works well -- except --
    With CTE AS
    SELECT *, ROW_NUMBER() OVER (Partition by fld1 order by fld1) RowNum
    FROM #tmpA
    DELETE From CTE
    WHERE RowNum > 1
    -- the actual table I need to delete duplicate rows on is based on 4 columns.  The following table contains 14,462 rows of which 14,348 are distinct -- based on the following 4 colums.  Below is an image of a sample of the data contained in the
    table for my question and to the right of that data is the column structures (data types).  Is it possible to do something like the above example suggestion with the table in the image below?  How to do that?  I need to delete rows so that 14462
    goes down to 14348.  If I only reference one column for the delete -- this would delete like 7000+ rows.  I only need to remove 114 rows.
    Rich P

    Add the other 3 columns to the partition.
    Jason Long

  • Deleting duplicate entries

    I have two tables (Accounts, and Accounts_LOAD). The _Load table is a daily feed.
    For my first step, I need to delete all the duplicates from _Load that exist in Accounts. 
    How can I delete duplicate entries which exist in two tables..?

    I think that the Merge will suffice. My apologies.
    But, now (again, sorry) I have a couple questions on the merge.
    Below is similar to what I would use and a few Q's on it....
    line4: can u use multiple "on" ?
    line5:For 'when matched' i only want to update fields from "_load" to "Accounts" that need to be updated. If they are the same, they would be ignored... is that possible...?
    1 MERGE INTO accounts acc
    2 USING (SELECT **ALLFIELDS**
    3 WHERE SOMESTUFF=STUFFS) STF
    4 ON (ACC.ID_USER = STF.ID_USER) AND (ACC.SYSTEM_ID = STF.SYSTEM_ID)
    5 WHEN MATCHED THEN UPDATE SET acc.bonus = D.bonus + S.salary*.01
    6 DELETE WHERE (S.salary > 8000)
    7 WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
    8 VALUES (S.employee_id, S.salary*0.1)
    9 WHERE (S.salary <= 8000);

  • Deleting duplicate photos in iPhoto 6

    I want to delete duplicate photos in iPhoto 6.  Thanks for your help in answering this question.
    Bill

    Some apps for dealing with duplicates in iPhoto
    iPhoto Library Manager
    Duplicate Annihilator
    Decliner
    iPhoto Duplicate Cleaner

  • Is there a way to delete duplicate photos in iPhoto? I have approx 10,000 duplicates?

    Is there a way to delete duplicate photos in iPhoto without having to delete them individually?

    The real question is how this happened - iPhoto is very good about avoiding duplicates and since you have a very large number it must be the result of a user error
    Why do you think you have 10,000 duplicates? How many photos total do you have?  Just making a guess I suyspect that sometime you moved to a new system and imported your old library into the new library - Hint - NEVER import an iPhoto library into another Photo library - it does not work and creates a massive mess.  If you  did import an iPhoto library into your current library the best solution (assuming teh old library is still available) is to drag the bad library to the desktop (if you have space to continue it is best to delete it later after everything is done and tested) and Connect the two Macs together (network, firewire target mode, etc)  or use an external hard drive formatted Mac OS extended (journaled) and drag the iPhoto library intact as a single entity from the old Mac to the pictures folder of the new Mac - launch iPhoto on the new mac and it will open the library and convert it as needed and you will be ready move forward.
    Even if you eliminate "duplicates" - in the suggested case they are not duplicates but different versions and at best you lose all edits and non-destructive editig done and are starting with original photos - not really good
    LN

  • HT2905 I want to delete duplicates from my iTunes music but cannot see "Display Exact Duplicates" in File menu.

    Hi,
    I want to delete duplicates from my iTunes music but and iTunes help says to click on "Display Exact Duplicates" in File men but I don't appear to have this function.  Where else can I look?

    Thanks Kappy. I had just found it but thanks reply.  Next question is:  Is there a quick way to then delete the duplicates without having to select each one and delete?

  • How to Delete duplicates rows without using rowid/distinct.

    How to delete duplicates rows present in a table without using rowid or even distinct.

    How about:
    SQL> SELECT * FROM t1;
             A          B
             1          2
             2          3
             1          2
             4          4
             4          4
             4          4
    SQL> DELETE FROM t1
      2  WHERE (a, b) IN (SELECT a, b FROM t1
      3                   GROUP BY a, b
      4                   HAVING COUNT(*) > 1) and
      5        rownum = 1;
    1 row deleted.
    SQL> /
    1 row deleted.
    SQL> /
    1 row deleted.
    SQL> /
    0 rows deleted.
    SQL> SELECT * FROM t1;
             A          B
             2          3
             1          2
             4          4Although, if I was asked a similar question with all those restrictions, my first response would be along the lines of: Is this question indicative of the way I will have to work if I join this company? If so, there is no point answering because I wouldn't touch this job with a ten foot pole.

  • How do I delete duplicates

    How do I delete duplicate songs from my playlist?

    Hey meant2opr8,
    Thanks for the question. We have a great resource that will help you easily resolve the duplicate items in your iTunes library:
    How to find and remove duplicate items in your iTunes library
    http://support.apple.com/kb/HT2905
    1. Choose View > Show Duplicate Items to show duplicate items (matches are based on the song name and artist). If you have multiple versions of the same song (for example, live and studio versions, or versions from different albums) you can hold the Alt or Option key (for Mac OS X) or the Shift key (for Windows) and choose View > Show Exact Duplicate Items. This will show only duplicate songs having the same name, artist, and album.
    2. Duplicate items will be sorted next to one another. Review each item to determine which one you'd like to remove from your library. You can compare the track length, date added, genre, play count, size, bit rate, and more to help you determine which item you'd like to keep and which item you'd like to remove.
    3. To delete an item, click the item to select it. Then remove the duplicate item by choosing Edit > Delete.
    4. When you are finished removing duplicate items from your library, click Show All Items at the bottom of the iTunes window.
    If the duplicate items were all added at the same time, you can use these handy steps to quickly delete them:
    - Sort the duplicate list by Date Added
    - Highlight all duplicates
    - Delete the highlighted items all at once.
    Thanks,
    Matt M.

Maybe you are looking for

  • Unlimited Plan throttled and punishment for overage

    Yes, I have read the fine print, previous entries, and understand that even with my grandfathered "Unlimited" broadband plan, Verizon will throttle back my speed when I go over 5gb. Here is what angers me.  Being a loyal VZW customer for over 9 years

  • Material group in Material master

    Dear All Warm greetings How to configure display of materials through material group? For end users Example when my user wants to view any material, system should only show the materials which he should as per material group Example while create Purc

  • Copy and open Command in Oracle 10g Linux (Minut, Ubuntu)

    Dear All; I am facing one problem we used to copy any document and for open any document in WINDOWS Host('CMD /C COPY '||'"'||:Old_Doc||'"'||' X:\03\03\'||:New_Doc); Client_Host('Cmd /C Start '||'X:\03\03\'||:New_Doc); But these commands not running

  • Error activating ODS-Inconsistency DD - DB ?

    Hi BW Gurus, My requirement is to change the field length of one InfoObject used in ODS object(ODS_T) from Numeric 3 to Numeric 4. When doing the activation of ODS, the system prompt for continue with Activate and Adjust Database in SE14. However, so

  • Why is IllegalStateException thrown in this Java Code Snippet ?

    This is one of the questions in a mock test. void waitForSignal()     Object obj=new Object();     synchronized(Thread.currentThread())            obj.wait();            obj.notify(); Which statement is true ? A. This code may throw and InterruptedEx