CSV to Postgres with different column order

Highlighted
Six Stars

CSV to Postgres with different column order

Hi I am new to Talend. I have a CSV file as source and Postgres table for target. The column order and the column names are different in CSV and Postgres.

How do I load the data using TMAP?

Tags (1)

Accepted Solutions
Employee

Re: CSV to Postgres with different column order

Hi,

 

    The column order is not a factor since you are using tMap. You define the source order in the left part of the tMap and create target order in the right side of tMap.

 

     Once you create the right order in both sides, its just drag and drop to the columns. Balance part Talend will take care :-)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)


All Replies
Employee

Re: CSV to Postgres with different column order

Hi,

 

    The column order is not a factor since you are using tMap. You define the source order in the left part of the tMap and create target order in the right side of tMap.

 

     Once you create the right order in both sides, its just drag and drop to the columns. Balance part Talend will take care :-)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

Nine Stars

Re: CSV to Postgres with different column order

Hi,

 

actually, there is no need to order the field: if the column names in the output row of the tMap have the same names that the PostgreSQL table, it won't matter (and if they don't, it will fail even if the order is correct).

 

Just read your input file (here the order is important), add your tMap with all the columns of your output table correctly named and map every input row to the corresponding output row and voilà!

 

Regards.

Seven Stars

Re: CSV to Postgres with different column order

@A_San  Just to let you know : column names are different isn't a problem

 

Import your csv input file , connect to tmap, and the target postgres file.

 

Map the source columns to the concern target column based on your requirement. Migrate the data.

 

Thanks,

Prabuj

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog