on 10-26-2004 7:03 PM
Hello,
I have the following problem. The file that is being generated is fixed length. However, there is no "\n" end line character in the end of each record. It is one big row of data. Is there any way to separate such file into records of information using File Adapter, since it seems with no "\n", File Adapter always has just ONE record.
Thank you for your help,
Dmitriy Mindich
Hi,
New line is the default. You should have multiple lines by default.
You might try the following:
xml.endSeparator=<lastSeparatorString>
where <lastSeparatorString> = \n
Regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We're running J2EE.
Specifying 'nl' is newline - I don't have newline, just one gigantic stream...
Example -
Row contains Header(1), Line(n)
All records are fixed-width
Header has 3 fields
===================
RecordType 3 chars (this is the key - indicated by 450)
OrderNum 5 chars
Order Type 2 chars
Line has 3 fields
===================
RecordType 3 chars (this is the key - indicated by 475)
LineNum 4 chars
PartNo 5 chars
So the data would look like this
450Ord01ZS4750001PartA4750002PartB
This would be an order w/ 2 lines. If I send this stream in, only the header is read, the lines are dropped, and my mapping fails b/c the lines need to be there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also try following sample configuration to split the record based on fixed length.
Plain2XML xml.recordsetStructure =HEADER,1,ITEM,*
Plain2XML xml.keyFieldName = ORDER_NUMBER
Plain2XML xml.keyFieldType = CaseSensitiveString
Plain2XML xml.HEADER.fieldNames= ORDER_NUMBER,field-shipto
Plain2XML xml.HEADER.fieldFixedLengths = 2,10
Plain2XML xml.ITEM.fieldNames = ITEM_NO,field-product,field-quantity
Plain2XML xml.ITEM.fieldFixedLengths = 2,5
I do have a lot of fields - between about 50-200, in 450 different interfaces. We did try the java program, but worry about performance problems during production. We'd rather use their solution.
The fixed length config below is exactly what we have - the problem is that it expects each change in record to have a newline between them. If you don't, then it only processes the headers & drops the lines off. That's why I'm trying to figure out how to override "endSeparator"
Hi Stefan,
Can you please explain creation of File Adapter module capable of inserting \n into the stream. I thought once you process message through adapter module, XML parsing has already been finished, meaning it is much more complicated to alter XML message.
Is there any way to alter character stream before XML parsing occurs?
Thank you in advance,
Dmitriy Mindich
Dmitriy, did you ever get this to work? I have the same scenario. I am trying to get endSeparator to work, but no luck yet. I can't seem to override the newline thing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
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.