Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Merge the difference between two files and save it on the first file. Also update the first file with info in second file.

by hdb (Prior)
on Oct 14, 2013 at 07:03 UTC ( #1058134=note: print w/replies, xml ) Need Help??


in reply to Merge the difference between two files and save it on the first file. Also update the first file with info in second file.

As a one-liner: (make sure you keep a copy of file1 around...)

perl -ne "/^([^=]+)/ and $_{$1}=$_; END {print sort values %_}" file1 +file2 > file1
  • Comment on Re: Merge the difference between two files and save it on the first file. Also update the first file with info in second file.
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058134]
help
Chatterbox?
[Corion]: Yay, it's Friday! All hail Crunchy!

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2016-12-09 07:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (148 votes). Check out past polls.