azure - 如何在 Azure 数据工厂中的 csv 文件前面添加一行?

标签 azure csv azure-data-factory

我在 Azure Blob 存储中有一个以下格式的 csv/txt 文件:

<表类=“s-表”> <标题> 第 1 列 第 2 列 第 3 列 <正文> 数据 数据 数据

在文本文件中,它看起来像:

列 1、列 2、列 3 等

数据、数据、数据等等

我尝试在 ADF 中添加一行作为文件中的第一行,使其看起来像:

BATCH IMPORT, IMPORT 1.0(逗号包含在此行中)

列 1、列 2、列 3 等

数据、数据、数据等等

我尝试使用合并文件,更改了周围的分隔符,但似乎无法使其工作。添加此行后无需处理数据。添加该行后,我将使用二进制复制事件将其发送到目的地。有没有办法在 ADF 中实现此目的,而不使用 Azure Functions 或批处理服务等外部源?

感谢您提前提供帮助。

编辑:如果可能的话,我也很乐意与 Azure Functions 合作来实现此目的?

最佳答案

我们可以使用data flow在 ADF 中实现这一点。

  1. 我们可以将包含标题 BATCH IMPORT, IMPORT 1.0 的 csv 或文本文件添加到 Azure Blob 存储。
    enter image description here

  2. 然后在 source1 我们连接到源 csv。 enter image description here

  3. 在源数据集中选择无分隔符enter image description here 数据预览如下: enter image description here

  4. 添加 headers.txt 的另一个源,其中包含单行 BATCH IMPORT, IMPORT 1.0 enter image description here

  5. 同样,在数据集中选择No delimiterenter image description here 数据预览如下: enter image description here

  6. Union1 事件中联合 headersource1 enter image description here 数据预览如下: enter image description here

  7. 然后我们可以下沉到 csv enter image description here

关于azure - 如何在 Azure 数据工厂中的 csv 文件前面添加一行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66484987/

相关文章:

azure - 使用 PowerShell 和应用程序环境变量从 Azure 批处理自定义事件调用 PowerShell 脚本

Azure数据工厂: Access web service residing in virtual network

azure - 将数组变量传递给 ADF 中的 IN 条件

arrays - 如何在azure逻辑应用程序中将字符串转换为数组

azure - 无法连接 Azure 容器服务 - Kubernetes

node.js - Azure Ubuntu VM 应用程序只能连接到端口 80

regex - 使用 PCRE 正则表达式从类似 CSV 的字符串中提取值,包括空字段

d3.js 中的 csv 到数组

iphone - 考虑将特殊字符放入 .csv 文件

azure - 将 Bearer token 与 azure-sdk-for-js 一起使用