MathGroup Archive 2008

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

Search the Archive

Re: Complement ...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93591] Re: Complement ...
  • From: "sjoerd.c.devries at gmail.com" <sjoerd.c.devries at gmail.com>
  • Date: Sun, 16 Nov 2008 07:05:03 -0500 (EST)
  • References: <gfimec$ft1$1@smc.vnet.net>

Hi Ignacio,

I've checked a few of the 10 numbers and it seems that they the line
they're on has a space character at the end in myList_1.txt and no
space in myList_2.txt. Hence, the strings are really different (but
not visually!), and Mathematica is therefore right.

Cheers -- Sjoerd

On Nov 14, 4:06 am, Ignacio Plazeta <Ignacio.Plaz... at speednet.es>
wrote:
>   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 urlhttp://rapidshare.com/f=
iles/163412702/myData.zip.html
>
> They are two simple plain text file no way harmful.
> ------------------------------------------------
>
>   Warmest regards.
>
>    Ignacio



  • Prev by Date: Re: LatticeReduce
  • Next by Date: Re: Basic programming
  • Previous by thread: Complement ...
  • Next by thread: Re: Complement ...