Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Complement ...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93528] Complement ...
  • From: Ignacio Plazeta <Ignacio.Plazeta at speednet.es>
  • Date: Thu, 13 Nov 2008 21:06:08 -0500 (EST)

  Hi !!

(running Mathematica 6.0.0 on an Itel - XP Pro PC)

I have two data file

    myList_1.txt
    myList_2.txt

both having a string on each line.

To get strings present in myList_2.txt
but not in myList_1.txt I try this

    SetDirectory[NotebookDirectory[]];
    myList1 = Import["myList_1.txt", "Lines"];
    myList2 = Import["myList_2.txt", "Lines"];
    comp = Complement[myList2, myList1];
    comp // TableForm

and something strange happens, because it
returns comp as a list of 10 elements.

That's impossibile, because myList_2.txt
is a subset of  myList_1.txt ( I did it
to check the metod ).

Moreover using a text editor I find
the 10 strings clearly present in myList1.txt

I am not capable to figure out any reason for that.
Do you ?

------------------------------------------------
If you want test it on my data, I have placed

    myList_1.txt
    myList_2.txt

in 4.2 Mb sized zip file ( myData.zip ) at the url
http://rapidshare.com/files/163412702/myData.zip.html

They are two simple plain text file no way harmful.
------------------------------------------------

  Warmest regards.

   Ignacio






  • Prev by Date: Re: Storing and Loading Definitions / Emulating Associative Arrays
  • Next by Date: Re: Unacceptable bug in Mathematica
  • Previous by thread: prolate spheroidal coordinates - alternative form
  • Next by thread: Re: Complement ...