Forum Discussion
Trouble Extracting CSV from Zipped Directory on Web Using Power Query
- 2 years ago
Hi Greg, thanks for reaching. The file seems to have a compression that's not allowed by the methods in the power query script. Zips have several settings for compression that makes kind of difficult to create a function that works for almost all of them. They way your file looks like should work with this alternativa function for extracting:
https://github.com/Michael19842/PowerBiFunctions/blob/main/ZipFile/Unzip.m
Remember this function only extracts. The interpretation of the file inside it's a different thing.
I hope that helps,
Ok, it makes sense, but I already used this function to get an XML file and it worked perfectly. However, in this case, the file wasn't embedded into a folder. Here's my M code:
let
Source = Web.Contents("https://www.data.gouv.fr/fr/datasets/r/e9bfe674-7872-4bbc-bddf-e146bc8690fa"),
DezipFiles = UnzipContents(Source),
#"Type modifié XML" = Xml.Tables(File.Contents("C:\Users\amala\Downloads\export-fiches-rncp-v3-0-2024-04-05\export_fiches_RNCP_V3_0_2024-04-05.xml"))
in
#"Type modifié XML"
Don't know if this may help you.
I'm looking forward to hearing from you,
AwatefM