mvt icon indicating copy to clipboard operation
mvt copied to clipboard

Save extracted records as csv

Open besendorf opened this issue 2 years ago • 3 comments

All the records are flat json files (no nested objects) so they represent a table. I think it would be easier for people to read the records if they were in .csv files as csv viewers usually display tables and json viewers display trees. MVT already generates the timeline.csv file. his could be an implemented as an optional parameter in the cli. Would you accept a PR for this? Are there any things that would have to be consired for you to merge such a PR?

besendorf avatar Feb 28 '22 12:02 besendorf

Hi,

Not all the output files are lists, some includes dictionaries, nested objects, lists with different entries etc. using JSON allows to have this flexibility. I understand the need for that but I don't think it can be done reliably without significant change to each module (likely a function to convert the results to a list). We would have to think about pros and cons, to me it seems like a lot of code for a minor change, but interested to hear what other people think about it.

Have you tried analysing the json files with jq maybe?

Te-k avatar Feb 28 '22 13:02 Te-k

I have used jq with the @tsv format which creates tab seperated values, but its a bit time-consuming to specify all the interesting fields for each records json file.

Example jq command for refernce: jq -r '["Date", "direction", "text"], (.[] | [.isodate, .direction, .text]) | @tsv' sms.json

I think the records that tend be produce quite large files are those would profit the most from a csv format. And are all flat json files. Those are from my recent scans, but might be more: calls.json, contacts.json, datausage.json, interaction_c.json, manifest.json, os_analytics_ad_daily.json, safari_history.json, sms.json, sms_attachments.json , tcc.json, whatsapp.json

besendorf avatar Feb 28 '22 14:02 besendorf

Here's a small python script to convert all records from json to csv. This isnt useful for all the records but was useful for me for the before mentioned records. Maybe someone finds this useful: https://gist.github.com/besendorf/9789bbd713f1fa3d4d9acd18be246973

besendorf avatar Mar 01 '22 09:03 besendorf