简体   繁体   English

如何在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

I want to import data from excel form to informatica and finally insert into DB table.我想将数据从 excel 表单导入到 informatica 并最终插入到数据库表中。 the data in the excel is in key:value format(ex. name : "xyz"(in the next right cell)) how can i import that data such that the "Name" becomes the column name and "xyz" becomes the data in informatica source? excel中的数据采用键:值格式(例如名称:“xyz”(在下一个右侧单元格中))我如何导入该数据,使“名称”成为列名,“xyz”成为数据在informatica 源?

Is there a reason the Excel file cannot be saved as a CSV first?是否有原因不能先将 Excel 文件另存为 CSV? If not, you'll an Excel connector.如果没有,您将使用 Excel 连接器。 Then you will need to convert the rows to columns.然后您需要将行转换为列。 There are a few approaches to that.有几种方法可以做到这一点。 Google them or search the Informatica Network.谷歌它们或搜索 Informatica 网络。

As i understood you want to convert {Name:value} pair in excel file to {Column:Row} in Informatica Source i have articulated input from your statement;据我了解,您想将 excel 文件中的 {Name:value} 对转换为 Informatica Source 中的 {Column:Row} 我已经阐明了您语句中的输入; Can you also propose your output for more clarification?您还可以提出您的输出以获得更多说明吗?

Input Name1:"Value1" Name2:"Value2" Name3:"Value3" Name3:"Value4"输入名称1:“值1”名称2:“值2”名称3:“值3”名称3:“值4”

Now, If you want to convert the file before importing it into informatica;现在,如果您想在将文件导入 informatica 之前对其进行转换; there are multiple functions in Excel to perform Like(VLOOKUP,XLOOKUP) please try to explore these if it can make some use. Excel 中有多个函数可以执行 Like(VLOOKUP,XLOOKUP) 请尝试探索这些是否可以使用。

Please Refer below to split your values: https://www.excelfunctions.net/split-string-in-excel.html请参考以下拆分您的值: https : //www.excelfunctions.net/split-string-in-excel.html

Or there is one more way you can perform 1. Import Excel file into informatica source with no changes in single column 2. Using Expression transformation - you can split the {name:value} pair into {Column:row} with regular expression(Refer infa sample workflow on pivot from google)或者还有另一种方法可以执行 1. 将 Excel 文件导入 informatica 源,单列中没有任何更改 2. 使用表达式转换 - 您可以使用正则表达式将 {name:value} 对拆分为 {Column:row}(请参阅infa 示例工作流程来自 google)

It can help with Output format as well.它也可以帮助输出格式。

Thanks谢谢

Here is your answer:这是你的答案:

Create first a temporary table eg TMP_RAW_DATA with one column.首先创建一个临时表,例如包含一列的TMP_RAW_DATA load all the values as they are into that table.将所有值按原样加载到该表中。 now load your table from that TMP_RAW_DATA table using sql to your new table现在使用 sql 从那个TMP_RAW_DATA table加载你的表到你的新表

Separate the Columns from the single raw data into multiple columns, then load them to your new table.将单个原始数据中的列分成多个列,然后将它们加载到新表中。

 SELECT 
        regexp_substr(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(value,'[A-Za-z0-9_-]+:',''), '(" ")+', '","'), '"', ''), '[^,]+', 1, 1) as COL_ONE,
        regexp_substr(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(value,'[A-Za-z0-9_-]+:',''), '(" ")+', '","'), '"', ''), '[^,]+', 1, 2) as COL_TWO,
        regexp_substr(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(value,'[A-Za-z0-9_-]+:',''), '(" ")+', '","'), '"', ''), '[^,]+', 1, 3) as COL_THREE 
 FROM  TMP_RAW_DATA 

You will have two mappings您将有两个映射

  • one for loading the raw data as it is into one column一种用于将原始数据按原样加载到一列中
  • two for loading from TMP_RAW_DATA table to your new table两个用于从 TMP_RAW_DATA 表加载到新表

db <> fiddle db <> 小提琴

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM