Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Create on-the-fly index column if you don't explicitly specify one #36

Open
friederschueler opened this issue Apr 20, 2018 · 2 comments

Comments

@friederschueler
Copy link

I wonder if you could point me to a starting point, how to implement this and if there are any caveats to think of.

Problem: I generate csv files from a database view and they don't have a unique identifier which could be used as index.
Idea: use the line number of the current row - 1 as index. (like adding a virtual colum in the csv)

With the current implementation this use-case will fail silently, as no changes are reported:
from csvdiff import *
diff_files("e.txt", "f.txt", [], ";")
I would like to implement this functionality and provide a pull request for this feature if you think that is a good idea.

e.txt
f.txt
I had to rename the files to .txt as github doesn't support .csv

@karakutu001
Copy link

I have the same problem. Did you resolve this problem?

I would like to compare two different csv. but unfortunately, csvdiff can't find all the line which are changed.

@friederschueler
Copy link
Author

@karakutu001 No, I needed a quick fix and it I just prefixed my data files with a "rowID" column and used that. But you are more than welcome to provide some code. I am busy right now, but I could help with it in the next weeks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants