question

Kira-22 avatar image
0 Votes"
Kira-22 asked ShaikMaheer-MSFT commented

Renaming a list of files

I have a list of folders each containing a liste of files, I am using a get metadata and copy activity to copy them into azure blob storage. I am looking for a way to rename my files dynamically , my current files have the pattern nameofFile_***.txt and I would like to rename it nameofFile.txt.


Thank you

azure-data-factory
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Kira-22 ,

Just checking in to see if the above answer helped. If this answers your query, do click 130616-image.png and upvote 130671-image.png for the same. And, if you have any further query do let us know.

0 Votes 0 ·

Hi @Kira-22 ,

Following up to see if the above answer helped. If this answers your query, do click 130616-image.png and upvote 130671-image.png for the same. And, if you have any further query do let us know.

0 Votes 0 ·

1 Answer

ShaikMaheer-MSFT avatar image
0 Votes"
ShaikMaheer-MSFT answered

Hi @Kira-22 ,

Thank you for posting your query on Microsoft Q&A Platform.

You need to have a parameter for your file name in Sink dataset and pass file name value dynamically to that parameter.

Below are detailed steps listed.

Step1: Using GetMetaData Activity, I am getting file name.

136193-image.png

Step2: Inside sink dataset have a parameter for file name and Pass your sink file name dynamically. Use expression language to get desired file name dynamically.
Here, I am using a variable and using below expression to dynamically compose my sink file name
expression used: @concat(split(activity('Get Metadata1').output.itemName,'_')[0],'.',split(activity('Get Metadata1').output.itemName,'.')[1])

136201-image.png

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


  • 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

  • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators




image.png (275.3 KiB)
image.png (100.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.