wiki: Update of "csvdiff"

Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 03c678f62c6498de76bdfabc9a94443ac0d3853a
Page Name:csvdiff
Date: 2010-05-25 20:54:12
Original User: paulfitz
Parent: fb2e9126b4776a63de93c71ef6088842983ce1d7
Content

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"