# Can we Extract ZIP file via  Excel Power Query.



## AJ_121 (May 12, 2020)

Dear,
i have a file path which has .Zip file and When i open that .Zip inside that i got a .CSV file which data i need.
another i have a file path which has .CSV file and i need to combine both .Zip file CSV File and this one.

But i am stuck because i am unable to download that zip file via power query and when i try then it comes in different language/Format.



Kindly help to download the data of zip file..

Any help will be appreciated.

Thanks.


----------



## alansidman (May 12, 2020)

Here is a link that should be helpful






						Reading Zip files in PowerQuery / M
					

Being a fan of PowerBI, I recently looked for a way to read zip files directly into the Data Model, and found this blog  which showed a usab...




					sql10.blogspot.com


----------



## AJ_121 (May 12, 2020)

Hi,
I did same as in above blog. but didn't get my result.
Below are the Steps what i have done:
Step 1- ref. image"Step1"

Step 2- ref. image "Query"

after doing this step i get this ref. image "image2"

but what to do now?? when i am doing open as CSV then it comes in different format/Binary/Language.

and other open as functions not working.

I tried a lot but didn't reach on actual data.


?here is that link which data i need "https://www1.nseindia.com/content/historical/DERIVATIVES/2020/MAY/fo12MAY2020bhav.csv.zip"
or "https://www1.nseindia.com/ArchieveSearch?h_filetype=fobhav&date=11-05-2020&section=FO " 

You can check the link and make the data as i need.

Kindly Help.
Thanks


----------



## sandy666 (May 12, 2020)

there is something wrong with the zip file (from your urls)
I tested on dummy data and it works


----------



## sandy666 (May 12, 2020)

maybe because this is for local files
`File.Contents("[Full path to your zip file]")`
not from web


----------



## AJ_121 (May 13, 2020)

sandy666 said:


> there is something wrong with the zip file (from your urls)
> I tested on dummy data and it works
> 
> View attachment 13709


It mean i can not get the data directly from web.. Am i right??


----------



## AJ_121 (May 13, 2020)

sandy666 said:


> maybe because this is for local files
> `File.Contents("[Full path to your zip file]")`
> not from web


I did change in File.Contents and made it Web.contents but i am getting this which is in Attached Image.    
And i did the same process for dummy zip file which is from different Source but same type of file which is in bytes as in attached image.


If any option to auto download option and get in excel sheet the data from my source website which i have mentioned, Let me know.


Thanks.


----------



## sandy666 (May 13, 2020)

You can try but i think you'll not be able to do that from the url

i tried with zip from the  url as local file but it doesn't work, with my own zip file it works as you can see on the image
as i sad there is something wrong with zip file from the url


----------



## AJ_121 (May 13, 2020)

sandy666 said:


> You can try but i think you'll not be able to do that from the url
> 
> i tried with zip from the  url as local file but it doesn't work, with my own zip file it works as you can see on the image
> as i sad there is something wrong with zip file from the url


Can you Share the steps that how we can Unzip a file from my pc local files.


----------



## sandy666 (May 13, 2020)

all is described under link post#2 . i can say nothing more except post image with steps order


----------



## AJ_121 (May 12, 2020)

Dear,
i have a file path which has .Zip file and When i open that .Zip inside that i got a .CSV file which data i need.
another i have a file path which has .CSV file and i need to combine both .Zip file CSV File and this one.

But i am stuck because i am unable to download that zip file via power query and when i try then it comes in different language/Format.



Kindly help to download the data of zip file..

Any help will be appreciated.

Thanks.


----------



## AJ_121 (May 13, 2020)

sandy666 said:


> all is described under link post#2 . i can say nothing more except post image with steps order


Thank you dear.


----------



## sandy666 (May 13, 2020)

you are welcome

just in case


----------



## AJ_121 (May 15, 2020)

sandy666 said:


> all is described under link post#2 . i can say nothing more except post image with steps order


Dear,
I have downloaded a dummy data file from internet and tried here in attached image to Unzip that dummy file but again failed.

Could you help?
and if i am doing any mistake please try to correct it.

Thanks.


----------



## sandy666 (May 15, 2020)

first check if zip file is blocked or no



unblock and try again

or try with my zip file: TinyUpload.com - best file hosting solution, with no limits, totaly free


----------



## sandy666 (May 15, 2020)

or even try with this excel file after you download DummyData.zip








						s666-PQ-unzip file.xlsx
					

Microsoft Excel Workbook



					1drv.ms
				



(_excel file should be downloaded first and saved on your computer_)
change path to the file in Source step of course


----------

