1

I am comparing a list of packages for a Django project in production and development. There are inconsistency in versions, but I am only concerned about the packages that got installed independently on another. So I am trying to get lines that are not matched (noted with -----) in vimdiff.

I can whip a python or perl script to do this, but I was wondering if there is a command line tool or achieve the same thing in Vim, because I think this can be useful for auditing other file sin the future.

2

Returns only lines with unique first word:

cut -d ' ' -f1 input?.txt | sort | uniq -u

input1.txt:

package1 v1
package2 v1
package3 v1
package4 v1
package5 v1

input2.txt:

package1 v1
package2 v2
package4 v4
package5 v5

output:

package3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.