Page 1 of 1

Tab delimated file pattern read

Posted: Fri Nov 02, 2012 10:43 am
by smohd1338
I have 3 differetn files with same format, they have , FH,BH,DL,SA,CC,BT,FT records, i have to pass them to seven different files which have only taht record along with their filenames, in transformer what condition should i put in order to make the records go into only those respective link, if it were fixed width i would give link.recordtype[1,2]=FH then go this link, but this is tab delimated, in this case how do i do that, any ideas

Posted: Fri Nov 02, 2012 11:20 am
by chulett
Really, you'd do basically the exact same thing. However, I would guess you'd just need to check the first field rather than substring anything but that will depend on how you have defined the file metadata.

Also... periods are your friend. Don't be afraid to use them. :wink:

Posted: Fri Nov 02, 2012 11:36 am
by chillblue
Hi ,


In Transformer Stage ... use INDEX() function as constraint for the link.

Look for the specific values in the stream and divert the data to corresponding output.


Hope this helps.

Posted: Fri Nov 02, 2012 12:42 pm
by smohd1338
what are periods and how can i use them, ?

Posted: Fri Nov 02, 2012 1:12 pm
by chulett
smohd1338 wrote:what are periods and how can i use them, ?
Image

Posted: Fri Nov 02, 2012 1:14 pm
by chulett
Sorry, just meant as in 'at the end of a sentence'. Was just trying to point out that your first post is one long run-on statement.

Posted: Fri Nov 02, 2012 1:39 pm
by chillblue
The Syntax is Index (string, substring, instance)



Make n number of links out to transformer.

In each link add a constraint which you need to check.

link 1:- INDEX(COLUMN,'FH',1) <> 0
link 2:- INDEX(COLUMN,'BH',1) <> 0
link 3:- INDEX(COLUMN,'DL',1) <> 0
same way for all the data......

Hope this solves your problem.

Posted: Fri Nov 02, 2012 1:48 pm
by smohd1338
tahnks all, i used Field instead