Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by Arunbear (Prior)
on Jun 18, 2014 at 13:37 UTC ( [id://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

Replies are listed 'Best First'.
Re^2: comparing 2 files and creating third file with uncommon content
by fullermd (Priest) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1090306]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 15:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found