Re: Flat-File to Xml Query...



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 some
challenges. The file formats and constraints are listed below:
Try something like this:
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

.



Relevant Pages

  • Re: A quick question about forwarding contacts
    ... These documents are based on earlier work documented in RFC 934, ... Internet mail header fields. ... printable US-ASCII characters before invoking a local mail UA (User ... which may have data or character set limitations. ...
    (microsoft.public.outlook.general)
  • Re: Where Should I Get the Latest SLRN?
    ... Discussions about updating the slrn ... When following-up on an article with no Newsgroups header, ... this function does not work with wide characters. ... installbin and installdirs swapped in the install ...
    (news.software.readers)
  • Re: Creating a Compressed File
    ... This also works fine but the extra Print command seems redundant. ... It writes a header of a standard length at the beginning of the ... The first two characters are PK (most likely in deference to Phil Katz ... This is required for Windows to believe it's a 'legal' zip file. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Flat-File to Xml Query...
    ... special character resulting in corrupting the remaining data in that ... While parsing I get error: ... Line number 2885 has the special characters and when replaced/removed ... type at the same level as Header and Detail records, ...
    (microsoft.public.biztalk.general)
  • RE: [Full-Disclosure] Sidewinder G2
    ... If you not current with security software to the last two years your screwed ... A search at Cert for "Secure Computing" and "Sidewinder: ... exploit contains characters outside of the set defined by RFC822 (aka binary ... (do you really need a HTTP host: header length greater than 50 characters?). ...
    (Full-Disclosure)

Quantcast