Answer the question
In order to leave comments, you need to log in
How to save diff of two text files to third file?
Let's say there are 2 identical CSV files with some upload (file1.csv and file2.csv). For example, a couple of lines have been added or changed to file2.csv. Is it possible somehow using the diff command (or else how) to compare these 2 files and the lines that differ, save them in a separate file. By default, diff stores the result in spec. format (arrows, separators), but in fact you need to simply save the different lines.
Answer the question
In order to leave comments, you need to log in
diff --changed-group-format="%>" --unchanged-group-format="" file1.csv file2.csv > newlines.csv
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question