shlogg · Early preview
Judy @esproc_spl

Comparing CSV Files With SPL: 3 Ways To Find Differences

Here are two csv files (A and B) with same structure. Use Java to compare them in three ways: 1. Equal primary keys with different values. 2. Records existing only in A. 3. Records existing only in B. Write results to new csv files.

Here are two csv files (A and B) of same structure. Both use KEY_A, KEY_B and KEY_C as the primary key, and the two have different records.

Use Java to compare the two files in three ways and write the results respectively to new csv files. 1. Find records where primary keys are equal and values of the other fields are not equal, output their primary keys and then the other fields of A and the other fields in B. Below is the expected result:


Find difference of A and B, that is, records existing in A but not existing in B, according to the primary key. Below is the expected result:


Find di...