Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

How do I compare the lines in two text file?

by Anonymous Monk
on Jul 31, 2000 at 09:15 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://25215]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-23 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found