简体   繁体   English

从另一个 CSV 文件(Azure 数据工厂)向 CSV 文件添加列

[英]Add column to CSV File from another CSV File (Azure Data Factory)

For example:例如:

Persons.csv人.csv

name, last_name
-----------------------
jack, jack_lastName
luc, luc_lastname

FileExample.csv文件示例.csv

id
243
123

Result:结果:

name, last_name, exampleId
-------------------------------
jack, jack_lastName, 243
luc, luc_lastname, 123

I want to aggregate any number of columns from another data source, to insert that final result in a file or in a database table.我想聚合来自另一个数据源的任意数量的列,以将最终结果插入文件或数据库表中。

I have been trying many ways but I can't do it.我一直在尝试很多方法,但我做不到。

You can try to make use of Mergefiles in azure data factory pipeline to merge two csv files.您可以尝试使用 azure 数据工厂管道中的 Mergefiles 合并两个 csv 文件。

Select copydata activity and go to source to loop through wild card entry *.csv to search for csv files in storage(configure linked storage to adf in this process). Select copydata activity 和 go to source 循环通过通配符条目 *.csv 在存储中搜索 csv 文件(在此过程中将链接存储配置为 adf)。

在此处输入图像描述

Then the create a output csv in the same container if required as in my case to merge files and store by naming it some examplemerge.csv.然后在同一个容器中创建一个 output csv,如果需要的话,就像我的情况一样,通过将其命名为 examplemerge.csv 来合并文件和存储。

在此处输入图像描述

Check mark the first row as header.将第一行标记为 header。

validate and try to debug.验证并尝试调试。

Then you must be able to see merged files in the resultant merged file in output folder.然后,您必须能够在 output 文件夹中的结果合并文件中看到合并文件。 在此处输入图像描述

You can check this reference vlog Merge Multiple CSV files to single CSV for more details and also this vlog on Load Multiple CSV Files to a Table in Azure Data Factory if required.您可以查看此参考vlog Merge Multiple CSV files to single CSV了解更多详细信息,如果需要,还可以查看此 vlog 将多个 CSV 文件加载到 Azure 数据工厂中的表

But if you want to join the files, there must be some common column to join.但是如果你想加入文件,必须有一些共同的列加入。 Also check this thread from Q&A Azure Data Factory merge 2 csv files with different schema还要从问答Azure 数据工厂合并 2 csv 具有不同模式的文件中检查此线程

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

相关问题 如何使用 Airflow 将 CSV 文件从 Azure Data Lake/Blob 存储传输到 PostgreSQL 数据库 - How to transfer a CSV file from Azure Data Lake/Blob Storage to PostgreSQL database with Airflow 使用 CSV 文件进行 Azure 情感分析 - Using CSV file for Azure Sentiment Analysis 从树莓派 CSV 文件到 Bigquery 表的数据流 - Data streaming from raspberry pi CSV file to Bigquerry table 如何将 csv 文件更快地翻译成另一种语言? - How to translate a csv file faster into another language? 使用 Azure 数据工厂将一些表从 MySQL 数据库归档到 Parquet 文件 - Data Archival of a few tables from MySQL database to Parquet file using Azure Data Factory 尝试将 csv 文件数据导入 Firestore - Trying to import csv file data to Firestore 将 Azure 数据工厂从一个账户迁移到另一个账户 - Migrate Azure Data Factory from one account to another account Azure数据工厂:无法将设置变量的output保存到文件/数据库中 - Azure Data Factory: Cannot save the output of Set Variable into file/Database Azure 存储 Blob:上传的 CSV 文件显示零字节 - Azure Storage Blob: Uploaded CSV file shows zero bytes 从 csv 文件或来自 google 文档的电子表格填充 appengine 数据库中的数据 - Populating data in appengine database from a csv file or spreadsheet from google docs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM