Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
1 year ago
Solved

Zip function from MARK WHITE

Hi good day,

Can anyone share the query function by MARK WHITE, coz now show error on his page.

 

 

Thank you

  • Here’s a general approach to decompress ZIP files in Power Query:

    1. Load the ZIP file:

      let
          Source = Binary.Buffer(File.Contents("path_to_your_zip_file.zip"))
      in
          Source
    2. Extract the contents:

      let
          Source = Binary.Buffer(File.Contents("path_to_your_zip_file.zip")),
          ZipStart = Binary.Start(Source, 4),
          ZipEnd = Binary.End(Source, 4),
          ZipContents = Binary.Middle(Source, ZipStart, ZipEnd)
      in
          ZipContents
    3. Convert the binary data to a table:

      let
          Source = Binary.Buffer(File.Contents("path_to_your_zip_file.zip")),
          ZipStart = Binary.Start(Source, 4),
          ZipEnd = Binary.End(Source, 4),
          ZipContents = Binary.Middle(Source, ZipStart, ZipEnd),
          TableFromZip = Table.FromList(ZipContents, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
      in
          TableFromZip

    Copied from AI Tool.

3 Replies

  • 123abc's avatar
    123abc
    Community Champion

     

    Please follow below coumminty links there these problems have alrady been dissucssed.

     

    Zip function from MARK WHITE - Microsoft Fabric Community

     

    Working With Zip Files in Power Query - Microsoft Fabric Community

     

    [PowerQuery] Decompress .zip Files - Microsoft Fabric Community

     

    I hope this helps!
    If you found this answer helpful:

    Mark it as the solution to help others find it faster.
    Give it a kudo to show your appreciation!
    Thank you for being an awesome community member!

    • 123abc's avatar
      123abc
      Community Champion

      Here’s a general approach to decompress ZIP files in Power Query:

      1. Load the ZIP file:

        let
            Source = Binary.Buffer(File.Contents("path_to_your_zip_file.zip"))
        in
            Source
      2. Extract the contents:

        let
            Source = Binary.Buffer(File.Contents("path_to_your_zip_file.zip")),
            ZipStart = Binary.Start(Source, 4),
            ZipEnd = Binary.End(Source, 4),
            ZipContents = Binary.Middle(Source, ZipStart, ZipEnd)
        in
            ZipContents
      3. Convert the binary data to a table:

        let
            Source = Binary.Buffer(File.Contents("path_to_your_zip_file.zip")),
            ZipStart = Binary.Start(Source, 4),
            ZipEnd = Binary.End(Source, 4),
            ZipContents = Binary.Middle(Source, ZipStart, ZipEnd),
            TableFromZip = Table.FromList(ZipContents, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
        in
            TableFromZip

      Copied from AI Tool.