Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

Six Stars

Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

Hi am using tmap for processing and tfilleoutput delimited for a csv output. in my output i am having an auto incremented columm named sl_no.. but it as not happening  as  i want. data has some repeated values.. i am using Numeric.sequence("s1",1,1).

coming output pattern:

sl_no ,name, place

2 ,xyz , la

12 ,tyu ,usa

34 ,hdd  ,ab

44,fffs,hf

Desired Output Pattern:

sl_no ,name, place

1,xyz , la

2 ,tyu ,usa

3 ,hdd  ,ab

4,fffs,hf

 

 


Accepted Solutions
Six Stars

Re: Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

Hi Sushil,

I am attaching here the mapping and tmap photos.

In tmap you can see that I am not taking the input for SNO ,I am directly incrementing in Variable and attaching it with the output.

 

I am getting the same output as described by you.

increment.PNGoutput_incremet.PNGtmap_inc.PNG

Eleven Stars

Re: Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

Add a new Int variable in tMap var1 and set the value to: Var.var1+1

Francois Denis

Tag as "solved" for others! Kudos to thanks!


All Replies
Six Stars

Re: Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

Hi Sushil,

I am attaching here the mapping and tmap photos.

In tmap you can see that I am not taking the input for SNO ,I am directly incrementing in Variable and attaching it with the output.

 

I am getting the same output as described by you.

increment.PNGoutput_incremet.PNGtmap_inc.PNG

Eleven Stars

Re: Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

Add a new Int variable in tMap var1 and set the value to: Var.var1+1

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Six Stars

Re: Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

@fdenis.Is my answer wrong ?

 

Eleven Stars

Re: Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

How many time and when is your Sequence S1 initialized or incremented. in a big job or in sub-job you can not know.

Francois Denis

Tag as "solved" for others! Kudos to thanks!

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch