Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Add CRLF to Flat File
- This topic has 4 replies, 1 voice, and was last updated 8 years, 4 months ago by
community-content.
-
AuthorPosts
-
-
January 8, 2007 at 5:48 PM #17158
Hi
I have to generate a Flat file from XML and add CRLF at the end,please let me know how to add this.
I have tried adding a dummy tag in the schema with Default Value as \r\n so that it automatically writes at the end of the file,but did'nt work
the data type was xs:string . Thanks for your help.
Thanks
Wincy
-
January 9, 2007 at 4:49 AM #17161
Wincy,
normally you should do this by the use of "child order". This can be either prefix, infix or postfix. It tells the assembler where to put record delimiters. I guess you need Postfix – that is, put delimiters (CR/LF) at the end of each record.
John D.
-
January 9, 2007 at 11:50 AM #17178
Hi John
Thanks 🙂 I added a dummy second child record and in the top node i gave Child order as Postfix and child delimiter as 0x0d 0x0a ..
it worked
– Wincy
-
May 16, 2008 at 4:20 PM #19688
hello Wincy,
Can you describe what you did in more detail ?
What if there is only one rootnode ? Example would be as follows:
<?xml version=”1.0″ encoding=”utf-16″ ?>– <xs:schema xmlns:b=”http://schemas.microsoft.com/BizTalk/2003“ xmlns=”http://PnS_OtherSubscriberSchemas.SASScrapData“ targetNamespace=”http://PnS_OtherSubscriberSchemas.SASScrapData“ xmlns:xs=”http://www.w3.org/2001/XMLSchema“><schemaEditorExtension:schemaInfo namespaceAlias=”b“ extensionClass=”Microsoft.BizTalk.FlatFileExtension.FlatFileExtension“ standardName=”Flat File“ xmlns:schemaEditorExtension=”http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions“ /><b:schemaInfo standard=”Flat File“ codepage=”65001“ default_pad_char=”“ pad_char_type=”char“ count_positions_by_byte=”false“ parser_optimization=”speed“ lookahead_depth=”3“ suppress_empty_nodes=”false“ generate_empty_nodes=”true“ allow_early_termination=”false“ early_terminate_optional_fields=”false“ allow_message_breakup_of_infix_root=”false“ compile_parse_tables=”false“ root_reference=”SASScrapData“ child_delimiter_type=”hex“ default_child_delimiter=”0x0D 0x0A“ /></xs:appinfo></xs:annotation><b:recordInfo structure=”delimited“ child_delimiter_type=”char“ child_delimiter=”|“ child_order=”infix“ sequence_number=”1“ preserve_delimiter_for_empty_data=”true“ suppress_trailing_delimiters=”false“ /></xs:appinfo></xs:annotation></xs:appinfo></xs:annotation></xs:sequence></xs:complexType></xs:element></xs:schema>Thanks in Advance.
tgbtg
-
May 19, 2008 at 11:21 AM #19694
Please disregard my inquiry.
I was succesfull in resolving my problem with the concept of having the “higher node” define the child delimiter as the 0x0D and 0x0A hex characters.
Thinking that others may have the same confusion or problem as I had, let me describe what I did to resolve the issue on not having the CRLF after each record.
With the schema generated from the Flat File Schema Wizard having a rootnode, and then all the elements under it. The resulting text output of the send port’s file set to “Append” in Copy mode has NO CRLF for every record. The flat file format requires the pipe as the delimiter and at the same time the column/fields are fixed – see the schema I posted previously.
My solution to the No-CRLF problem:
1 – Add a child node under the rootnode.
2 – Move all the elements from the rootnode to the childnode added in step1.
3 – Specify the rootnode to have the following child delimiter specifications:
child delimiter: 0x0D 0x0A
child delimiter type: hexadecimal
child order: PostFix
4. Specify the childnode (added in step#1) to have the following child delimiter specifications:
child delimiter: |
child delimiter type: Character
child order: Infix
I hope this is clearer for the BizTalkers who will encounter the same problem and are confused.
Regards !
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.