Closed jarib closed 3 years ago
I'd be happy to teach the tool to look for export.xml
or eksport.xml
- and then expand that list to other languages.
The "first XML file in the root" solution is probably easier though!
I switched my phone to Spanish and ran an export - I got a file called exportar.zip
. Unzipped I still got a apple_ health_export
folder but the root contained:
electrocardiograms/
export_cda.xml
exportar.xml
workout-routes/
It looks like export_cda.xml
does not have a translated name, so maybe I can ignore it and look for the other .xml
file in that directory.
I think the safest thing is to sniff the first few lines of the file. Those should be the same no matter the language that was used:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HealthData [
Checking for either <!DOCTYPE HealthData
or <HealthData
in the first 1000 bytes should do it.
OK, if you upgrade to the just-released 1.0 this should work (it worked against my Spanish export).
Nice! Works perfectly. Thanks for the quick response and great tooling in general.
The XML file exported from my phone has a Norwegian file name –
eksport.xml
🙄I can work around this by unpacking the zip and using
--xml
, but then I lose the workout points.Perhaps this could be solved by
--localized-xml eksport.xml
? Alternatively just fall back to the first XML file in the root folder of the zip.