Share via

Azure data factory

Rishi Patel 21 Reputation points
2022-05-20T10:46:01.92+00:00

I have file names in adls gen 2 container
With format domain_term_20200114.csv
I want to change the format of date
From 20200114 to 2020-01-14 for all files.
Can someone suggest how to achieve this using add dynamic content and expression language in azure.

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


Answer accepted by question author

Samy Abdul 3,376 Reputation points
2022-05-20T11:29:03.897+00:00

Hi@Rishi Patel , as it has been mentioned in below thread, we need to use the derived column , todate and coalesce function for this.

https://learn.microsoft.com/en-us/answers/questions/135485/azure-data-factory-date-conversion.html Thanks

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Nandan Hegde 36,886 Reputation points MVP Volunteer Moderator
    2022-05-20T11:57:39.52+00:00

    Hey,
    Please use the below expression :
    @markus.bohland@hotmail.de (split(variables('Test'),'' )[0],'',split(variables('Test'),'' )[1],'',concat(substring(split(variables('Test'),'' )[2],0 , 4),'-',substring(split(variables('Test'),'' )[2],4 , 2),'-',substring(split(variables('Test'),'_' )[2],6 , 6)))

    where the Test is a variable containing your file name

    Was this answer helpful?


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.