Reading fixed-length text files inside Data Factory or Synapse Analytics

pmscorca 1,052 Reputation points
2023-07-26T13:04:53.4966667+00:00

Hi,

I need to implement a ADF of Synapse Analytics solution in order to read some fixed-length text files, to control and process them and finally to save the processed data in a SQL table.

I've seen this article https://learn.microsoft.com/en-us/azure/data-factory/how-to-fixed-width that talks about how handling this case with a data flow.

I'd like to know if it exists a different and better solution respect to use a data flow.

Any suggests to me, please? Thanks

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
{count} votes

2 answers

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,737 Reputation points Microsoft Employee Moderator
    2023-07-26T23:11:09.76+00:00

    @pmscorca Welcome to Microsoft Q&A forum and thanks for reaching out here.

    As you rightly pointed out, using mapping data flow (as explained in this document) is the ideal way if you want to implement it through ADF/synapse pipelines.

    If you want to explore other options:

    1. You may write your own code logic and execute it in either custom activity or Azure Function activity in ADF/Synapse pipelines.
    2. Another apporach is using the Apache spark in Synapse or Databricks notebooks as explained in below articles and execute those notebooks from Synapse pipelines:

    Hope this info helps.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.


  2. KranthiPakala-MSFT 46,737 Reputation points Microsoft Employee Moderator
    2023-08-05T00:11:21.01+00:00

    @pmscorca - Thanks for the additional context and clarification of the requirement. Sure, Same thing you can do in derived column with substring with hardcoded start and end.

    Read each line as single column and then as mentioned above you can implement defining the schema using derived column.

    Hope this info helps.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.


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.