Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Artifact ID: | 8621a518060944a65e3a76088554a70a8006d08d |
---|---|
Page Name: | ssdiff |
Date: | 2010-09-22 20:59:09 |
Original User: | paulfitz |
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:
- If called with "--format-csv", the output is a valid .csv file, and so can be read and viewed with the same programs used to edit or view the inputs. In this case, the output is intended to be used to construct the modified spreadsheet from the original using sspatch rather than patch.
- In principle, differences between spreadsheets could be better described than in regular diffs, by exploiting the regularity of spreadsheet structure. (Whether ssdiff actually achieves this yet is another story).
- For some transformations, such as column reordering, a big saving would be possible.
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"