Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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

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
Node Status?
node history
Node Type: note [id://1090306]
help
Chatterbox?
and a kettle whistles...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2017-10-20 02:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (258 votes). Check out past polls.

    Notices?