samedi 8 août 2015

Anonymise SQLite database?

Problem: I have a table with first name, surname, and gender columns. I need to partially anonymise the database, by replacing all the names in this table with arbitrary made-up names. I also have a spreadsheet with lots of gender-specific arbitrary names.

Given this, how do I iterate through the rows of this table, and replace each name in turn with a name from the spreadsheet?

I can do this in C fairly trivially, but it's a days work - export the spreadsheet as CSV, and then iterate through the rows of the table, updating each name with the next one from the CSV file. However, I can't help feeling that there's a much simpler way to do this by turning the CSV name data into a script, but I've got no idea how to iterate through the table from a script. Any pointers/ideas appreciated.

Aucun commentaire:

Enregistrer un commentaire