How to copy xml files from multiple folders and sub folders to one single container

Mohan Parashetti Veerabhadrappa 25 Reputation points
2023-11-17T10:27:07.96+00:00

We want to copy only xml files from multiple folders and sub folders to single blob. And we need to know name and path of the files are copied.

Folder structures looks something like below.

Folder1/SubFolder2/SubFolder3/abc.xml

Folder4/SubFolder2/ddc.xml

Folder3/SubFolder7/SubFolder6/SubFolder5/zzz.xml

output should look something like below in container

abc.xml

ddc.xml

zzz.xml

The solution which i have tried are as below

  1. copy activity with recursive checks on & filter file as *.xml. But here its along with file its copying enter folder structure as well. but we are looking to copy xml files into one single folder. and we are not able to know the path of the files and file name which are copied.User's image
  2. using Get metadata -> for each -> get metadata will get to know the files only when there is file under folder and within sub folder. It wont work for all the folder structures.
Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nandan Hegde 36,716 Reputation points MVP Volunteer Moderator
    2023-11-17T11:26:30.4933333+00:00

    Hey,

    The below blog :

    https://datasharkx.wordpress.com/2023/02/06/calculate-folder-size-of-an-azure-blob-storage-data-lake-storage-via-synapse-data-factory-pipeline/

    should cover the aspect of covering all folders and subfolder
    and rather than using getmeta data activity at the end to get size, you can use Copy activity to copy from source to your desired destination


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.