How to Read the Whole Flat File or XML File as one Field of String Data Type?

If you want to read a flat file or an XML file as one string field, use UniversalDataReader and set the metadata on its first output port as follows:


<Metadata id="Metadata0" previewAttachment="${DATAIN_DIR}/inputFile.txt" previewAttachmentCharset="ISO-8859-1">
<Record name="recordName1" previewAttachment="${DATAIN_DIR}/inputFile.txt" previewAttachmentCharset="ISO-8859-1" type="delimited">
<Field eofAsDelimiter="true" name="field1" type="string"/>
</Record>
</Metadata>

In other words, you must delete both field delimiter and record delimiter and set the EOF as delimiter attribute to true. This way the whole file will be read as one record consisting of one field of string data type.

file_reading.txt · Last modified: 2009/09/16 12:27 (external edit)
Back to top
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0