Re: Flat-File to Xml Query...
- From: "Pabba" <kiran.pabba@xxxxxxxxx>
- Date: 28 Dec 2006 11:08:53 -0800
I fixed the issue and could proceed further but struck with another
problem, there are some special characters(à) in data as part of
Detail record Description fields. Is there anyway to skip/avoid/escape
parsing these characters?
While parsing I get error:
"error BEC2004: Unexpected data found while looking for:
'\r\n'
The current definition being parsed is Record. The stream offset where
the error occured is 320233. The line number where the error occured is
2885. The column where the error occured is 108."
Line number 2885 has the special characters and when replaced/removed
operation succeeds.
Let me know if there is a way to skip characters while parsing the
flat-file.
TIA,
Kiran
Pabba wrote:
Jan,
I missed one more constraint which holds me proceed further. Apart from
Header/Detail I have another top level record (Group) that starts from
position 0. Listed below is an example:
GROUP1 Group1 Desc
ABC ABC Header Desc Type1
XYZZZZZ XYZZZZZ Header Desc Type1
6100 XYZZZZZ - 6100 Detail Desc Type1
6150 XYZZZZZ - 6150 Detail Desc Type1
6160 XYZZZZZ - 6160 Detail Desc Type1
PQR PQR Header Desc Type1
6310 PQR - 6310 Detail Desc Type1
GROUP2 Group2 Desc
STUVWX STUVWX Header Desc Type1
JKLMNOP JKLMNOP Header Desc Type2
7000 JKLMNOP - 7000 Detail Desc Type2
7002 JKLMNOP - 7000 Detail Desc Type2
7004 JKLMNOP - 7000 Detail Desc Type2
7005 JKLMNOP - 7000 Detail Desc Type2
GROUP3 Group3 Desc
SSSSS SSSSS Header Desc Type3
12121 12121 Detail Desc Type3
When I try to modify the exisiting schema to add this Group as a Record
type at the same level as Header and Detail records, at runtime I see
that after each Header/Detail parsing it tries to create Group Record
though it has to continue till it completes all Header/Detail
combinations in that Group.
Expecting something like:
<Root>
<GroupRecord>
<Group>
<Name>GROUP1</Name>
<Description>GROUP1 Desc</Description>
</Group>
<Record>
<Header>
<Id>ABC</Id>
<Description>ABC Header Desc</Description>
<Type>Type1</Type>
</Header>
</Record>
<Record>
<Header>
<Id>XYZZZZZ</Id>
<Description>XYZZZZZ Header Desc</Description>
<Type>Type1</Type>
</Header>
<Detail>
<DetailId>6100</DetailId>
<Description>XYZZZZZ - 6100 Detail Desc</Description>
<Type>Type1</Type>
</Detail>
<Detail>
<DetailId>6150</DetailId>
<Description>XYZZZZZ - 6150 Detail Desc</Description>
<Type>Type1</Type>
</Detail>
<Detail>
<DetailId>6160</DetailId>
<Description>XYZZZZZ - 6160 Detail Desc</Description>
<Type>Type1</Type>
</Detail>
</Record>
<Record>
<Header>
<Id>PQR</Id>
<Description>PQR Header Desc</Description>
<Type>Type1</Type>
</Header>
<Detail>
<DetailId>6310</DetailId>
<Description>XYZZZZZ - 6310 Detail Desc</Description>
<Type>Type1</Type>
</Detail>
</Record>
</GroupRecord>
<GroupRecord>
<Group>
<Name>GROUP2</Name>
<Description>GROUP2 Desc</Description>
</Group>
<Record>
<Header>
<Id>STUVWX</Id>
<Description>STUVWX Header Desc</Description>
<Type>Type1</Type>
</Header>
<Record>
<Header>
<Id>JKLMNOP</Id>
<Description>JKLMNOP Header Desc</Description>
<Type>Type2</Type>
</Header>
<Detail>
<DetailId>7000</DetailId>
<Description>JKLMNOP - 7000 Detail Desc</Description>
<Type>Type2</Type>
</Detail>
<Detail>
<DetailId>7002</DetailId>
<Description>JKLMNOP - 7002 Detail Desc</Description>
<Type>Type2</Type>
</Detail>
<Detail>
<DetailId>7004</DetailId>
<Description>JKLMNOP - 7004 Detail Desc</Description>
<Type>Type2</Type>
</Detail>
<Detail>
<DetailId>7005</DetailId>
<Description>JKLMNOP - 7005 Detail Desc</Description>
<Type>Type2</Type>
</Detail>
</Record>
</GroupRecord>
<GroupRecord>
<Group>
<Name>GROUP3</Name>
<Description>GROUP3 Desc</Description>
</Group>
<Record>
<Header>
<Id>SSSSS</Id>
<Description>SSSSS Header Desc</Description>
<Type>Type3</Type>
</Header>
<Detail>
<DetailId>12121</DetailId>
<Description>SSSSS - 12121 Detail Desc</Description>
<Type>Type2</Type>
</Detail>
</Record>
</GroupRecord>
</Root>
Please let me know how to acheive this.
TIA,
Kiran
Jan Eliasen wrote:
On 22 Dec 2006 11:48:16 -0800, "Pabba" <kiran.pabba@xxxxxxxxx> wrote:
I have to convert a flat-file to xml and in this process I see someTry something like this:
challenges. The file formats and constraints are listed below:
http://www.eliasen.dk/biztalk/flatfilespacesidentifier.zip - I have
changed the example document you have provided in your posting, as
there were not the same number of characters on each line, and I
assume the format is positional.
--
eliasen, representing himself and not the company he works for.
Private blog: http://blog.eliasen.dk
Private email: jan@xxxxxxxxxx
.
- Follow-Ups:
- Re: Flat-File to Xml Query...
- From: Jan Eliasen
- Re: Flat-File to Xml Query...
- From: Pabba
- Re: Flat-File to Xml Query...
- References:
- Flat-File to Xml Query...
- From: Pabba
- Re: Flat-File to Xml Query...
- From: Jan Eliasen
- Re: Flat-File to Xml Query...
- From: Pabba
- Flat-File to Xml Query...
- Prev by Date: Re: Issue with Custom Pipeline component
- Next by Date: addition of record field number via map
- Previous by thread: Re: Flat-File to Xml Query...
- Next by thread: Re: Flat-File to Xml Query...
- Index(es):
Relevant Pages
|