Ignore preceding and trailing field separator

These examples show transformations that use ignore preceding and trailing field separator.

Ignore Preceding

If this option is used a record that starts with a field separator ignores this first field. Otherwise, it is considered an empty field.

Flat File Definition:

<BankRepository>
	<Files>
		<File>
			<ID>SampleEleven</ID>
			<Messages>
				<Message>
               <IgnorePrecedingFieldSeparator>1</IgnorePrecedingFieldSeparator>
               <DefaultEmptyFieldValue>
                  <Numeric>0</Numeric>
                  <Alpha></Alpha>
                </DefaultEmptyFieldValue>
                <DefaultAlignment>
                  <Numeric>RIGHT</Numeric>
                  <Alpha>LEFT</Alpha>
                </DefaultAlignment>
                <DefaultPadding>
                  <Numeric>0</Numeric>
                  <Alpha> </Alpha>
                </DefaultPadding>
                <DefaultTrim>
                  <Numeric>1</Numeric>
                  <Alpha>0</Alpha>
                </DefaultTrim>
					<Name>TopNode</Name>
					<TagName>TopNode</TagName>										
					<EscapeChar/>
					<RecordSeparator>\n</RecordSeparator>
					<FieldSeparator>:</FieldSeparator>
					<Records>
						<Record>
							<Name>RecordOne</Name>
							<TagName>RecordOne</TagName>
							<MinOccur>1</MinOccur>
							<MaxOccur>0</MaxOccur>
							<Fields>
								<Field>
									<Name>Field1</Name>
									<TagName>Field1</TagName>
									<DataType>Alpha</DataType>
									<PaddingChar/>
									<DecimalLength/>
									<Alignment>LEFT</Alignment>
									<StartPos>0</StartPos>
									<Length>0</Length>
									<DefaultValue></DefaultValue>
									<Identifier>0</Identifier>
								</Field>
								<Field>
									<Name>Field2</Name>
									<TagName>Field2</TagName>
									<DataType>Alpha</DataType>
									<PaddingChar/>
									<DecimalLength/>
									<Alignment>LEFT</Alignment>
									<StartPos>0</StartPos>
									<Length>0</Length>
									<DefaultValue></DefaultValue>
									<Identifier>0</Identifier>
								</Field>
							</Fields>
						</Record>
					</Records>
				</Message>
			</Messages>
		</File>
	</Files>
</BankRepository>

Input File:

Input without a preceding field separator. Note that this input is not used, it is only shown as a reference.

a:b:
c:d

Input with preceding field separator is:

a:b:
c:d

Ignore Trailing

If a field separator is the last field in a record, it is not mandatory. And, this is not a configurable behavior.

Flat File Definition:

<BankRepository>
	<Files>
		<File>
			<ID>SampleEleven</ID>
			<Messages>
				<Message>
               <IgnorePrecedingFieldSeparator>1</IgnorePrecedingFieldSeparator>
               <DefaultEmptyFieldValue>
                  <Numeric>0</Numeric>
                  <Alpha></Alpha>
                </DefaultEmptyFieldValue>
                <DefaultAlignment>
                  <Numeric>RIGHT</Numeric>
                  <Alpha>LEFT</Alpha>
                </DefaultAlignment>
                <DefaultPadding>
                  <Numeric>0</Numeric>
                  <Alpha> </Alpha>
                </DefaultPadding>
                <DefaultTrim>
                  <Numeric>1</Numeric>
                  <Alpha>0</Alpha>
                </DefaultTrim>
					<Name>TopNode</Name>
					<TagName>TopNode</TagName>										
					<EscapeChar/>
					<RecordSeparator>\n</RecordSeparator>
					<FieldSeparator>:</FieldSeparator>
					<Records>
						<Record>
							<Name>RecordOne</Name>
							<TagName>RecordOne</TagName>
							<MinOccur>1</MinOccur>
							<MaxOccur>0</MaxOccur>
							<Fields>
								<Field>
									<Name>Field1</Name>
									<TagName>Field1</TagName>
									<DataType>Alpha</DataType>
									<PaddingChar/>
									<DecimalLength/>
									<Alignment>LEFT</Alignment>
									<StartPos>0</StartPos>
									<Length>0</Length>
									<DefaultValue></DefaultValue>
									<Identifier>0</Identifier>
								</Field>
								<Field>
									<Name>Field2</Name>
									<TagName>Field2</TagName>
									<DataType>Alpha</DataType>
									<PaddingChar/>
									<DecimalLength/>
									<Alignment>LEFT</Alignment>
									<StartPos>0</StartPos>
									<Length>0</Length>
									<DefaultValue></DefaultValue>
									<Identifier>0</Identifier>
								</Field>
							</Fields>
						</Record>
					</Records>
				</Message>
			</Messages>
		</File>
	</Files>
</BankRepository>

Input File:

Input without trailing field separator and with preceding separator:

:a:b
:c:d