Vector data load

Highlighted
Six Stars

Vector data load

Hi,

I have a file having 7 columns, then 7th column can be further splitted into several records on the basis of delimiter( ; ), In Ab Initio, I separate this 7th column in vector, but don't know how to do this in talend, can someone suggest on this.

e.g. the file has a record like a,b,c,d,r,f,g[100], like g[1] is like x,y,z,i,j,k and so on.. Number of 7th column records are not fixed.

Thanks in advance.


Accepted Solutions
Nine Stars

Re: Vector data load


@mani1304 wrote:

Thanks buddy, I did this in tjavaflex but how to do this in tMap, what would be the datatype for this, but I was looking something similar to vectors, but seems here this is missing.

 


You can use the List data type.  To build a list from the String array you could do this:

 

output_row.gList = java.util.Arrays.asList(input_row.g.split(","));

 

--
Please give Kudos and mark topics as solved where appropriate.

View solution in original post


All Replies
Nine Stars

Re: Vector data load

Just use the split method native to Java strings:

 

String[] data = input_row.g.split(",");

You can use it in a tMap, a tJava* component or anywhere an expression is allowed.

--
Please give Kudos and mark topics as solved where appropriate.
Six Stars

Re: Vector data load

Thanks buddy, I did this in tjavaflex but how to do this in tMap, what would be the datatype for this, but I was looking something similar to vectors, but seems here this is missing.

 

Nine Stars

Re: Vector data load


@mani1304 wrote:

Thanks buddy, I did this in tjavaflex but how to do this in tMap, what would be the datatype for this, but I was looking something similar to vectors, but seems here this is missing.

 


You can use the List data type.  To build a list from the String array you could do this:

 

output_row.gList = java.util.Arrays.asList(input_row.g.split(","));

 

--
Please give Kudos and mark topics as solved where appropriate.

View solution in original post

Six Stars

Re: Vector data load

Thanks, it works

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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog