Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: comparing 2 files and creating third file with uncommon content

by Arunbear (Parson)
on Jun 18, 2014 at 13:37 UTC ( #1090306=note: print w/ replies, xml ) Need Help??


in reply to comparing 2 files and creating third file with uncommon content

If this is not just for the sake of learning to use Perl, this type of task can be done with well known command line tools e.g.

diff -n file1 file2 | egrep -v '^[ad]' > file3
will find the differences and write them to file3.

You may need to install cygwin or native versions of these tools.


Comment on Re: comparing 2 files and creating third file with uncommon content
Download Code
Re^2: comparing 2 files and creating third file with uncommon content
by fullermd (Curate) on Jun 18, 2014 at 18:19 UTC

    Or just use comm(1).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-10-02 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (55 votes), past polls