Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

How do I compare the lines in two text file?

by Anonymous Monk
on Jul 31, 2000 at 09:15 UTC ( #25215=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: (files)

I wish to compare the lines from file1.txt with file2.txt and export what are the missing lines not found in file2.txt to another result.txt

Originally posted as a Categorized Question.

  • Comment on How do I compare the lines in two text file?

Replies are listed 'Best First'.
Re: How do I compare the lines in two text file?
by lhoward (Vicar) on Jul 31, 2000 at 16:23 UTC
    The CPAN module Algorithm::Diff is also built for doing this sort of thing.
Re: How do I compare the lines in two text file?
by davorg (Chancellor) on Jul 31, 2000 at 10:35 UTC

    If you're on a system that supports it, the easiest way might be to use the Unix diff command.

    For a pure Perl solution, you might be able to do something with the Array::Compare module from CPAN.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://25215]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2021-04-21 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?