简体   繁体   English

如何转换 Azure 数据工厂中没有列 header 的 excel 文件

[英]How to transform the excel file which doesn't have the column header in Azure Data Factory

I am getting one excel file every day in the data lake.我每天在数据湖中收到一个 excel 文件。 My requirement is to export the excel file into an SQL database using ADF.我的要求是使用 ADF 将 excel 文件导出到 SQL 数据库中。 I have five sheets in the excel file.我在 excel 文件中有五张纸。 Among the five, I have one excel sheet that doesn't have one column header. I successfully exported all four sheets into the SQL database.在这五个中,我有一张 excel 表没有一列 header。我成功地将所有四张表导出到 SQL 数据库中。

I stuck with the above one sheet which doesn't have a column header. Below is the data for this excel sheet我坚持使用上面一张没有列 header 的表格。下面是这张 excel 表格的数据在此处输入图像描述

See, the first column doesn't have a header. When I tried to use copy activity, the schema is neglecting the first column as it doesn't have a header. When I untick the first row as a header, then it's recognised.看,第一列没有 header。当我尝试使用复制活动时,架构忽略了第一列,因为它没有 header。当我取消第一行为 header 时,它被识别了。 However, I don't want to use this because the column header for other columns considers a row value which is difficult as everyday new excel file is getting added.但是,我不想使用它,因为其他列的列 header 认为行值很难,因为每天都会添加新的 excel 文件。

Any advice on how to address this issue?关于如何解决这个问题的任何建议? Tried a lot, with no success.尝试了很多,没有成功。

I tried to reproduce this issue.我试图重现这个问题。 But initially I got below error.但最初我遇到了以下错误。

ErrorCode=DelimitedTextColumnNameNotAllowNull,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The name of column index 1 is empty. ErrorCode=DelimitedTextColumnNameNotAllowNull,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=列索引 1 的名称为空。 Make sure column name is properly specified in the header row.,Source=Microsoft.DataTransfer.Common,'确保在 header 行中正确指定了列名称。,Source=Microsoft.DataTransfer.Common,'

在此处输入图像描述

Source File:源文件:

在此处输入图像描述

So I used DataFlow activity and resolved the issue.所以我使用了 DataFlow 活动并解决了这个问题。

Follow below steps.请按照以下步骤操作。

Step1: Select Excel as Source.第一步: Select Excel 作为来源。

在此处输入图像描述

在此处输入图像描述

Step2: Select transformation settings. Step2: Select改造设置。

在此处输入图像描述

Step3: Execute Pipeline. Step3:执行流水线。

Data stored in SQL DB.数据存储在 SQL DB 中。

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取单元格值并将其写入新列。 Excel 到 SQL 复制活动 Azure 数据工厂 - How to grab a cell value and write it as a new column. Excel to SQL copy activity Azure Data Factory 如何读取Azure数据工厂中的.BAK文件? - How to read an .BAK file in Azure data factory? 复制带有空标头的 Excel 文件 Azure 数据工厂 (ADF) - Copy an Excel file with empty headers Azure Data Factory (ADF) Azure 数据工厂 - 复制数据正在将 excel 文件转换为应用程序/八位字节流 - Azure Data Factory - Copy data is converting excel file to application/octet-stream 从另一个 CSV 文件(Azure 数据工厂)向 CSV 文件添加列 - Add column to CSV File from another CSV File (Azure Data Factory) 在使用 terraform 部署脚本以启用 Azure 数据工厂中的客户管理密钥时,我收到一个错误,我在下面说明了这一点 - On deploying Script to enable Customer Managed Key in Azure Data Factory using terraform, I am getting an error which I have stated below 如何手动更新 Azure 数据工厂中的管道 - How to update manually a pipeline in Azure Data Factory 如何在 Azure 数据工厂中执行 SQL 查询 - How to execute a SQL query in Azure Data Factory 如何为 Azure 数据工厂中的文件位置(通配符文件路径)提供动态表达式路径? - How to give dynamic expression path for file location (Wildcard file paths) in Azure data factory? 有没有办法将纯文本/字符串作为 Azure 数据工厂中的活动 output - Is there a way to have plain text/string as an activity output in Azure Data Factory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM