Processing csv file to Postgres

Seven Stars

Processing csv file to Postgres

Hi,

 

I have a csv file (attached) to load in my db table and I have this requirement based on a specific field:

 

In my CSV:

if field code_operator1=BETWEEN_START must exist code_operator2=BETWEEN_END

The problem is that in my Table I have only one field code_operator, instead in cvs I have code_operator1 and code_operator2. How can I insert code_operator2 after code_operator1 in the database column (code_operator)?

I have the same issue for code_entity and attr_value fields.

 

In need to find a way to insert data in my Table as follow:

 

uidcode_operatorcode_entityattr_value
1BETWEEN_STARTco1VTrns0
2BETWEEN_ENDco1VTrns99,99
3BETWEEN_STARTco1VTrns150
4BETWEEN_ENDco1VTrns199,99
Highlighted
Forteen Stars

Re: Processing csv file to Postgres

Hi,

 

as variant - read file twice ind insert into database

 

uid - Numeric.sequence("s1",1,2)
code_operator - code_operator1
code_entity - code_entity1
attr_value - attr_value1

 

 

and second time:

uid - Numeric.sequence("s1",2,2)
code_operator - code_operator2
code_entity - code_entity2
attr_value - attr_value2

in this case, you will keep sequence for rows, BETWEEN_END will follow after BETWEEN_START

 

possible there are other solutions could be there

 

regards, Vlad

-----------

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now