Re: How to filter the contents of two text files.
Some little help is needed here ... I have two text files, each has just a single column of data FileA has 2798 entries, while FileB has 4242 entries; There are entries in FileA that are also in FileB... I'd like to filter against the two files, so I only get those entries in FileB that don't occur only in FileA There are a couple of commands to do exactly what you want. comm(1) -- select or reject lines common to two files http://www.freebsd.org/cgi/man.cgi?query=commapropos=0sektion=0manpath=FreeBSD+6.1-RELEASEformat=html diff(1) -- find differences between two files http://www.freebsd.org/cgi/man.cgi?query=diffapropos=0sektion=0manpath=FreeBSD+6.1-RELEASEformat=html sort(1) -- sort lines of text files http://www.freebsd.org/cgi/man.cgi?query=sortapropos=0sektion=0manpath=FreeBSD+6.1-RELEASEformat=html Enjoy! DA+ -- David Robillard UNIX systems administrator Oracle DBA CISSP, RHCE Sun Certified Security Administrator Montreal: +1 514 966 0122 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
How to filter the contents of two text files ..
Hi Some little help is needed here ... I have two text files, each has just a single column of data FileA has 2798 entries, while FileB has 4242 entries; There are entries in FileA that are also in FileB... I'd like to filter against the two files, so I only get those entries in FileB that don't occur only in FileA I am thinking about using `diff` but again it doesn't look quite straight to me. How do I get the data from FileB that isn't in FileA ? There could be many possible ways but I am simply brain dead at the moment. -Wash http://www.netmeister.org/news/learn2quote.html DISCLAIMER: See http://www.wananchi.com/bms/terms.php -- +==+ |\ _,,,---,,_ | Odhiambo Washington[EMAIL PROTECTED] Zzz /,`.-'`'-. ;-;;,_ | Wananchi Online Ltd. www.wananchi.com |,4- ) )-,_. ,\ ( `'-'| Tel: +254 20 313985-9 +254 20 313922 '---''(_/--' `-'\_) | GSM: +254 722 743223 +254 733 744121 +==+ Lysistrata had a good idea. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How to filter the contents of two text files ..
In the last episode (Aug 07), Odhiambo Washington said: Some little help is needed here ... I have two text files, each has just a single column of data FileA has 2798 entries, while FileB has 4242 entries; There are entries in FileA that are also in FileB... I'd like to filter against the two files, so I only get those entries in FileB that don't occur only in FileA If your files are sorted, you can use the 'comm' command. -- Dan Nelson [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How to filter the contents of two text files ..
On Aug 7, 2006, at 3:40 PM, Odhiambo Washington wrote: I have two text files, each has just a single column of data FileA has 2798 entries, while FileB has 4242 entries; There are entries in FileA that are also in FileB... I'd like to filter against the two files, so I only get those entries in FileB that don't occur only in FileA See man comm; also note that you will have to sort the contents of files first. -- -Chuck ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]