简体   繁体   English

如何处理来自 Informatica 中 CSV 的不正确数据

[英]How to handle improper Data Coming from CSV in Informatica

I have source file (CSV) and need to load into target (Oracle).我有源文件 (CSV),需要加载到目标 (Oracle)。 But I got an error但我有一个错误

FR_3065 ROW[4],Filed [Student_rollnumber]:Invalid Number:[.].The row will be skipped FR_3065 ROW[4],归档[Student_rollnumber]:无效编号:[.]。将跳过该行

CSV TABL CSV 表

Student_rollnumber,Studnet_Name,Marks,Subjects
10,'Revanth',70,"Maths",
11,'Satish',85,Science
12,'Anil',75,"Java
",
13,'Surya',90,"C++",
14,'Ramana',85,"python",
15,'Sudheer'70,"Informatica
",
16,'Prakash',85,"SQL"

I found that in line number 4 the qouts and comma(",) are in the next line how to concat that both ("Java",) And make it single column(Subject)我发现在第 4 行中,qouts 和逗号(“,)在下一行如何连接它们(“Java”,)并使其成为单列(主题)

MatchQuotesPastEndOfLine mentioned by Koushik should work. MatchQuotesPastEndOfLine提到的 MatchQuotesPastEndOfLine 应该可以工作。

Alternatively you may use sed with below pattern to replace newline+" with simply just a " - as a result removing the new line at the end of quoted string.或者,您可以使用 sed 和下面的模式来替换newline+" ,只需一个" - 结果删除引用字符串末尾的新行。

sed ':a;N;$!ba;s/\n"/"/g'

Feel free to test this gist .随意测试这个要点

This however will remove just the ending new line and will not help if it's anywhere in the middle.但是,这只会删除结尾的新行,如果它位于中间的任何位置,则无济于事。 As said, the MatchQuotesPastEndOfLine mentioned by Koushik is the best possible solution.如前所述, MatchQuotesPastEndOfLine提到的 MatchQuotesPastEndOfLine 是最好的解决方案。

Above has been based on this question .以上一直基于这个问题

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

相关问题 如何在Informatica的间接加载中为每个文件的数据定义指标 - How to define a indicator for the data from each file in the indirect load in Informatica 如何使用Informatica从受密码保护的Excel文件中读取数据 - How to read data from password protected excel file with informatica 如何从Informatica云数据集成调用存储过程? - How to call a stored procedure from Informatica cloud data integration? 如何从2个表(父表和子表)中导入数据?-informatica - how to import data from 2 table(parent and child table)?-informatica 如何使用Informatica从多个Excel文件读取数据 - How to read data from multiple Excel files with Informatica 如何在Informatica中处理高值/低值 - How to handle high values/low values in informatica 如何在informatica中导入excel表格? 我想将数据从 excel 表单导入到 informatica 并最终插入到数据库表中 - how to import excel form in informatica? I want to import data from excel form to informatica and finally insert into DB table 如何在 Informatica Data Hub 中过滤属性 - How to filter attributes in Informatica Data Hub 如何使用Informatica透视行数据? - How to pivot row data using Informatica? informatica中如何获取json格式的数据? - How to get data in json format in informatica?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM