-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add diff functions #90
Comments
It could be its own function that compares the data against the existing file:
If io.writeDiffSync('path/to/file.csv', 'path/to/diff.diff', data, { overwrite: false }) Or the third argument is the out path and is optional. if it doesn't exist, it outputs to the console // to file
io.writeDiffSync('path/to/file.csv', data, 'path/to/diff.diff', { overwrite: false }) // to console
io.writeDiffSync('path/to/file.csv', data, { overwrite: false }) It gets a little confusing since you have that options object already optional. |
I think an actual diff file (text file with HEAD >>> . <<<<) wouldn't be all that useful in the csv context (can't open it in excel for one) but if there was an output of Of course because you would need three sets of data: modified, added, removed that would be difficult to pull into a single As an aside, I've always dreamed of the equivalent of Excel sheets within a single |
One more thing that could prove difficult is how you identify rows. Above as
Was the operation that the last two rows were modified? or were two rows removed and two completely separate rows added? |
Sometimes when I'm doing some data cleaning, I want to know the diff between my current attempt and a previous one. It would be interesting if there is an out function that would diff the two results.
For example, let's say you have a script that outputs this file
and then you make some changes and now it outputs this data
This function would write out the diff of these two
The text was updated successfully, but these errors were encountered: