Re: [SLUG] handy way to merge txt files?
On 5 Oct, Andrew Bennetts wrote: On Fri, Oct 05, 2001 at 04:02:16PM -1000, cpaul wrote: hi - i have two plaintext files i want to merge them, discarding duplicate lines is there an easy way ? You really need to say what you mean by merging the two files. If you want to read one line at a time from each, and then remove duplicate lines, you'd need something like - blend script: cut here #!/bin/sh MYNAME=`basename $0` if [ $# != 2 ] then echo usage: $MYNAME file1 file2 2 exit 1 fi exec 3 $1 exec 4 $2 more=true while $more do more=false read line 03 echo $line more=true read line 04 echo $line more=true done - cut here Then you'd: blend file-a file-b | uniq luke -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
Re: [SLUG] handy way to merge txt files?
*** REPLY SEPARATOR *** On 5/10/2001 at 4:02 PM cpaul [EMAIL PROTECTED] [gregausit/slug] wrote: hi - i have two plaintext files i want to merge them, discarding duplicate lines is there an easy way ? cat and sort come to mind, read the man page on sort, IIRC -u is the option . Regards Greg Wright -- IT Consultant Sydney Australia PH 0418 292020 -- Int. +61 418 292020 Available for Global Contracts US Fax -- 801 740 2874 Web http://www.ausit.comE-mail Greg AT AusIT.com Trading As - AAA Computers -- providers of IT services. -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
Re: [SLUG] handy way to merge txt files?
Andrew Bennetts [EMAIL PROTECTED] wrote: If you don't mind reordering the lines: cat file1 file2 | sort | uniq file3 Which can be rewritten as sort -u file1 file2 file3 -- Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ ) Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
[SLUG] handy way to merge txt files?
hi - i have two plaintext files i want to merge them, discarding duplicate lines is there an easy way ? thx! chris paul -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
Re: [SLUG] handy way to merge txt files?
on Fri, Oct 05, 2001 at 04:02:16PM -1000, cpaul [EMAIL PROTECTED] wrote: hi - i have two plaintext files i want to merge them, discarding duplicate lines is there an easy way ? cat file1 file2 | sort | uniq BB -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
Re: [SLUG] handy way to merge txt files?
On Fri, Oct 05, 2001 at 04:02:16PM -1000, cpaul wrote: hi - i have two plaintext files i want to merge them, discarding duplicate lines is there an easy way ? If you don't mind reordering the lines: cat file1 file2 | sort | uniq file3 -Andrew. -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug