wiki: ssdiff

Not logged in

ssdiff

Called as:

ssdiff --output output.txt original.csv modified.csv

This generates an output describing the changes in modified.csv (compared with original.csv). This is analogous to a standard diff file describing differences between text files, but with the following differences:

Under development

The current implementation of ssdiff is just a placeholder, and does the flexibility of ssmerge a disservice.

Example

Suppose the original spreadsheet is:

<sheet> Altitude,Probe A,Probe B,Probe C,Comment 1000,10,20,30,"Wing vibration" 2000,15,25,52,"Wing vibration" 3000,3,66,89,"Ominous silense" 4000,3,42,12,"Ominous silense" </sheet>

And the modified spreadsheet is:

<sheet> Altitude,Probe A,Probe B,Probe C,Comment 500,5,10,7,"Smooth flight" 1000,10,20,30,"Wing vibration" 2000,15,25,52,"Wing vibration" 3000,3,66,89,"Ominous silence" 4000,3,42,12,"Ominous silence" </sheet>

Then output of ssdiff (at the time of writing -- there is lots of potential for improvement so the output is likely to change):

column names are [0],[1],[2],[3],[4]
insert row with * = 500,5,10,7,"Smooth flight"
for row with [0],[1],[2],[3] = 3000,3,66,89 set [4] = "Ominous silense" -> "Ominous silence"
for row with [0],[1],[2],[3] = 4000,3,42,12 set [4] = "Ominous silense" -> "Ominous silence"

With the "--format-csv" option, and run through the helper application csv2html, the output is:

<sheet> for,0,1,2,3,4,5 do,select,,,,, +++,1+1,500,5,10,7,"Smooth flight" -,4,,,,,"Ominous silense" +,4,,,,,"Ominous silence" -,5,,,,,"Ominous silense" +,5,,,,,"Ominous silence" </sheet>

A regular diff would give:

1a2
> 500,5,10,7,"Smooth flight"
4,5c5,6
< 3000,3,66,89,"Ominous silense"
< 4000,3,42,12,"Ominous silense"
---
> 3000,3,66,89,"Ominous silence"
> 4000,3,42,12,"Ominous silence"