4 ms·
For diff on whole rows, use you could use Linux' CLI tools, in particular join(1) which is very similar to SQL's [LEFT/RIGHT] JOIN clause. Another option is the
by dexen 8y ago
For diff on whole rows, use you could use Linux' CLI tools, in particular join(1) which is very similar to SQL's [LEFT/RIGHT] JOIN clause. Another option is the combination of sort(1) and uniq(1); with proper choice of options, and, in some cases, repeating the file with old or new data, you can get:
cat old.csv old.csv new.csv | sort | uniq -u # only the added/changed records
cat old.csv new.csv new.csv | sort | uniq -u # only the ol d/deleted records
cat old.csv new.csv | sort | uniq -d # only the unchanged records
- tudelo 8y agoAlso I think sort has a -u flag.
- SubMachineGhost 8y agoIf you use sort -u you don't have two repeat files (: