Hi, you may go through this link, where there's a detailed information to process fixed length files. https://learn.microsoft.com/en-us/azure/data-factory/how-to-fixed-width If your requirement is different, as Nandan has requested, please share a sample file with details. Thanks.
Data factory read file by position
Hello, I have a txt file with several columns, and there is no delimiter. We find the columns by index (position). How can I read this file from a data factory and copy the contents into a table with several columns Thanks,
3 answers
Sort by: Most helpful
-
-
Emilio Salas Roura 25 Reputation points
2024-02-19T05:40:36.19+00:00 Yes, that's exactly what I'm trying to do. But when I want to test this example I had this error.
Importing the projection. Where can I see the error details (view notification)
-
Pinaki Ghatak 4,535 Reputation points Microsoft Employee
2024-04-08T08:32:03.82+00:00 Hello @Emilio Salas Roura
To read a text file with several columns and no delimiter, you can use the Custom delimited format in the Azure Data Factory. In this case, you can specify the column widths as the delimiter.
Here are the steps to do this:
- Create a new dataset in your Azure Data Factory and select the
Azure Blob Storage
connector as the source. - In the dataset settings, specify the path to your text file in the
File path
field. - In the
Format
section, selectCustom delimited
as the format. - In the
Column delimiter
field, specify the column widths as the delimiter. For example, if your first column is 10 characters wide and your second column is 5 characters wide, you would specify "10,5" as the delimiter. - In the
Schema
section, specify the column names and data types for each column in your text file. - Create a new dataset for your destination table in Azure SQL Database and select the
Azure SQL Database
connector as the sink. - In the dataset settings, specify the table name and the Azure SQL Database linked service.
- In the
Mapping
section, map the columns from your source dataset to the columns in your destination table. Once you have created both datasets, you can create a pipeline to copy the data from your source dataset to your destination dataset using theCopy Data
activity. In theCopy Data
activity, select your source and destination datasets and specify any additional settings, such as the frequency of the copy operation.
I hope this helps! Let me know if you have any further questions.
- Create a new dataset in your Azure Data Factory and select the