Ask Your Question
1

Static length fields

asked 2019-06-08 13:38:06 -0500

anonymous user

Anonymous

updated 2019-06-08 13:47:35 -0500

metadaddy gravatar image

How do we read static length fields in a record if we know the start and end position. We might have different kind of files with different position file. For each file i should not define the logic. It has to be a dynamic implementation.

Input Data: ABCDEFGHIJ

Postion :

Col1 : 0,3 Col2 : 3,2 Col3 : 5,1 Col4 : 6,2

Output Data : Col1 :ABCD Col2 : EF Col3 : G Col4 : HIJ

edit retag flag offensive close merge delete

Comments

How do you determine the field offsets? Are they in a file header? Are they indicated by a file extension?

metadaddy gravatar imagemetadaddy ( 2019-06-08 13:48:13 -0500 )edit

It will be in a separate file or in database which says from which position it has to pick

Vss@2019 gravatar imageVss@2019 ( 2019-06-09 00:15:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-06-10 10:04:17 -0500

metadaddy gravatar image

Use either Text or Binary format in the origin to read the data in. Then you will need to use a script evaluator (Jython, JavaScript or Groovy) to read the configuration data, then split the incoming fields using a substring function.

edit flag offensive delete link more

Comments

If this possible to use expression evaluator to achieve the solution

Vss@2019 gravatar imageVss@2019 ( 2019-06-10 11:03:46 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-06-08 13:38:06 -0500

Seen: 53 times

Last updated: Jun 10