Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

parsing a flat file - positional with blank date field

1 view
Skip to first unread message

kap...@rose-hulman.edu

unread,
Jul 6, 2005, 9:34:27 AM7/6/05
to
I have a flat file that I am trying to parse. One of the elements is a
date. I have specified it as such (xs:date) and set the format as
"yyMMdd". The problem is that sometimes the date in the flat file will
come in blank...six spaces. In that case, I receive an error. I can fix
the problem by making that field a string instead. It seems there has
to be a way for it to recognize whether there is a date or a blank
field and then respond appropriately - check if the date is valid or
just put in blank fields.

Anyone know if this is possible, or if I have to make it a string?

Thank you,
Anna

Jeff Lynch

unread,
Jul 6, 2005, 6:02:37 PM7/6/05
to
Try changing the following for this field:

Pad Character Type = Hexadecimal
Pad Character = 0x20 (SPACE)
Minimum Length with Pad Character = 6

I think this will work with the xs:date type.

--
Jeff Lynch
"A BizTalk Enthusiast"
http://codebetter.com/blogs/jeff.lynch


<kap...@rose-hulman.edu> wrote in message
news:1120656867.6...@g44g2000cwa.googlegroups.com...

carlos

unread,
Jul 6, 2005, 6:17:24 PM7/6/05
to
you can use this...

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Scorpio.BizTalk.Schemas.DateTime"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://Scorpio.BizTalk.Schemas.DateTime"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:schemaInfo count_positions_by_byte="false"
parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false"
generate_empty_nodes="true" allow_early_termination="false" standard="Flat
File" root_reference="Root" />
<schemaEditorExtension:schemaInfo namespaceAlias="b"
extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension"
standardName="Flat File"
xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions"
/>
</xs:appinfo>
</xs:annotation>
<xs:element name="Root">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="true"
sequence_number="1" child_order="postfix" child_delimiter_type="hex"
child_delimiter="0x0D 0x0A" escape_char_type="hex" escape_char="0x20" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Dtime" nillable="true">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="1"
datetime_format="yyMMdd" pad_char_type="none" />
</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:union memberTypes="xs:date xs:string" />
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

<kap...@rose-hulman.edu> wrote in message
news:1120656867.6...@g44g2000cwa.googlegroups.com...

kap...@rose-hulman.edu

unread,
Jul 7, 2005, 12:55:56 PM7/7/05
to
Ahh, it didn't work. Although the union memberTypes really seems to be
getting at what I'm trying to get it to do. It definately seems like it
should work, but it's not. Maybe I'm missing something else. Any ideas?

<xs:element minOccurs="0" name="NETWORK_SETTLEMENT_DATE"


nillable="true">
<xs:annotation>
<xs:appinfo>

<b:fieldInfo sequence_number="35"
justification="left" pos_length="6" datetime_format="yyMMdd" />


</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:union memberTypes="xs:date xs:string" />
</xs:simpleType>
</xs:element>


Thanks,
Anna

0 new messages