Five 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

 

 

2 ACCEPTED SOLUTIONS

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

Ten 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

Don't forget to tag when it's "solved"!

4 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

Ten 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

Don't forget to tag when it's "solved"!

Six Stars

Re: Generate auto_incermental serial_no for the tfileoutputdelimted csv tmap

@fdenis.Is my answer wrong ?

 

Ten 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

Don't forget to tag when it's "solved"!