[YLUG] Subtracting one list from another.

Gaffer derrick_s at tesco.net
Sun Mar 25 16:37:43 BST 2007


Hello Everybody,

Thankyou very much for the help !  I got there in the end, or at least 
somewhere close !

I hadn't realised that there may be non printing characters hidden in 
the files that i was trying to compare.  Also I missed a switch "-r" 
which didn't help.  

Of course I am now curious as to why there should be non printing 
characters, other than new lines, carriage returns and white space in 
a text file !  One file created from "ls > g1.txt" and the other from 
a text file copied from another machine via drag n drop.

On Sunday 25 March 2007 12:27, Gaffer inscribed thus:
> Hi Guys,
>
> How can I subtract items from two lists where one list has items
> that are not in the other list in order to get a list of those
> items ?
>
> Sorry if that sounds confusing !
>
> I have tried   "diff -a g1.txt g2.txt > g3.txt"  but I end up with
> a file that is as big as the sum of the g1 + g2 file sizes and
> seems to have as entries that are not in either file.
>
> cmp just says the first line is different and stops.
>
> I'm obviously doing something wrong..........!!

-- 
Best Regards:
             Derrick.



More information about the York mailing list