[英]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.