on 01-13-2009 12:32 PM
Hi,
i am getting a error when using a substring
Scenario : from Flat file to IDoc
input = 30 char
output1 = first 10 chars
output2 = last 4 chars
when my input filed has the maximum number of characters say 30 in this case, then my scenerio works fine.
but if my input string has only first 6 chars, remaining all "spaces" . i get a stringindexoutof boundexception, when i post a flat file. Can anyone tell me if we are suppose to handle such conditions differently
In file content conversion you have to use parameter
XXX.fieldContentFormatting nothing
to keep the spaces.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you could do it like:
> if input.length >= 10 char
> output1 = first 10 chars
> else output1 = input
> if input.length >= 4 chars
> output2 = last 4 chars
> else output2 = input
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can handle this condition in the Graphical mapping or with the use of UDF. Make sure with the functional team that how the data is coming in source file. Or always put an condition in UDF like if(a.length > n) then write your code.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.