Posted: Tue Dec 19, 2006 1:19 am Post subject: Validating the fixed width file read using File Extender
Newbie
Joined: 07 Dec 2006 Posts: 8
Hi,
I am using the File Extender to read a fixed width file which has one header and multiple childs as below:-
abb
cccdddd
cccdddd
cccdddd
There are two issues that I am facing:-
1) The file extender does not throw a validation error when the data exceeds the expected length.
2) Since the file is a fixed width file I have created TDS message set and have entered the length of each string. The issue that I am facing is that the carriage return and newline character are also interpreted as part of the data. So the data that is read is as follows:-
Header:-
Field1 - a
Field2 - bb
Child1:-
Field1 - \r\nc
Field2 - ccdd
Child2:-
Field1 - dd\r
Field2 - \nccc
Child3:-
Field1 - ddd
Field2 - d\r\nc
Please suggest what setting do I need to do for MB to ignore the new line characters and throw an error when the data exceeds the limit.
Since the file is a fixed width file I have created TDS message set and have entered the length of each string
It's not really fixed-width. It is delimited by \r\n. It just happens that your lines are usually the same length.
Your TDS physical format should be using 'All Elements Delimited' with a delimiter of <CR><LF>. Within that, you need another complex type or group with Data Element Separation set to 'Fixed Length'.
Quote:
The file extender does not throw a validation error when the data exceeds the expected length
Did you expect it to? What is the expected length? What kinds of validation error do you require?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum