[33027] in Perl-Users-Digest
Perl-Users Digest, Issue: 4303 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 26 16:09:16 2014
Date: Sun, 26 Oct 2014 13:09:03 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 26 Oct 2014 Volume: 11 Number: 4303
Today's topics:
Comparing lines of strings between two files? <tuxedo@mailinator.com>
Re: Comparing lines of strings between two files? <rweikusat@mobileactivedefense.com>
Re: Comparing lines of strings between two files? <jurgenex@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 26 Oct 2014 19:57:39 +0100
From: Tuxedo <tuxedo@mailinator.com>
Subject: Comparing lines of strings between two files?
Message-Id: <m2jg74$eq4$1@news.albasani.net>
I have two sometimes identical and often quite large text files containing
an ASCII string on each line, starting immidietaly at the beginning of the
line up until the end-of-line for each complete string. There's never a
duplicate line, so each complete string is always unique.
What is a good way to compare and print any strings that may be missing in
the second file?
Should I use a regular expression to check for a non-match for each line in
the second file, or is there some module or built-in procedure to do this
in a memory efficient way?
Many thanks for any tips.
Tuxedo
------------------------------
Date: Sun, 26 Oct 2014 19:04:08 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Comparing lines of strings between two files?
Message-Id: <87fvead55j.fsf@doppelsaurus.mobileactivedefense.com>
Tuxedo <tuxedo@mailinator.com> writes:
> I have two sometimes identical and often quite large text files containing
> an ASCII string on each line, starting immidietaly at the beginning of the
> line up until the end-of-line for each complete string. There's never a
> duplicate line, so each complete string is always unique.
>
> What is a good way to compare and print any strings that may be missing in
> the second file?
comm -2 -3 <file #0> <file #1>
------------------------------
Date: Sun, 26 Oct 2014 12:12:28 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Comparing lines of strings between two files?
Message-Id: <vohq4a1k4j4k6h74e49cmrd29u1eppqmtd@4ax.com>
Tuxedo <tuxedo@mailinator.com> wrote:
>I have two sometimes identical and often quite large text files containing
>an ASCII string on each line, starting immidietaly at the beginning of the
>line up until the end-of-line for each complete string. There's never a
>duplicate line, so each complete string is always unique.
>
>What is a good way to compare and print any strings that may be missing in
>the second file?
diff file1 file2 | grep '^<'
Or maybe there is even an option for grep to report deleted lines only,
too lazy to check.
jue
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 4303
***************************************