unzip only csv files from my zip file

Eduardo Dallabrida 21 Reputation points
2022-08-31T20:33:04.513+00:00

I have a zip file that contains multiples csv and txt files. But I only need the csv files. is there a way to unzip only those csv files?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,334 questions
0 comments No comments
{count} votes

Accepted answer
  1. ShaktiSingh-MSFT 12,941 Reputation points Microsoft Employee
    2022-09-01T10:34:08.327+00:00

    Hi @Eduardo Dallabrida ,

    Welcome to Microsoft Q&A platform and thanks for using Azure services.

    As I understand your ask, you have zip file which contains csv and txt extension files, and you want to unzip only csv files.
    Please correct if my understanding does not comply.

    This task can be accomplished in Azure Data Factory using two Copy activities.

    Pipeline would look like this:

    236924-image.png

    Steps are as follows:

    . First connect to the Source dataset as shown here:

    236800-image.png

    Browse to the Input Zip file location as a Binary Dataset, use Compression Type as ZipDeflate and Compression Level as Optimal.

    . Next set the Sink dataset as below:

    236931-image.png

    This step would Decompress/Unzip and Copy all csv and txt files from Source to Sink.

    . Next step is to consider only "csv" files from the Sink of above step.
    For this we will take another copy activity and connect to the Sink location of the previous step here as source as:
    236850-image.png

    Here in wildcard file path, we will mention the folder path with type of file as *.csv which will consider all files ending with .csv.

    . Finally create the final Sink dataset for this Copy activity as below:

    236942-image.png

    Thank you!

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification

0 additional answers

Sort by: Most helpful