Reader

From DISMARC Help

(Difference between revisions)
Jump to: navigation, search
(CsvRecordReader)
(ISO2709RecordReader)
Line 15: Line 15:
; FirstLineIsHeader : Is the first line the header line, then thsi line will be used as attribute for the XML output
; FirstLineIsHeader : Is the first line the header line, then thsi line will be used as attribute for the XML output
-
== ISO2709RecordReader ==
+
== Iso2709recordReader ==
 +
This Reader doesn't take any settings as it used the standard. It will create a MARC-XML out of the text file.
== XmlRecordReader ==
== XmlRecordReader ==

Revision as of 08:12, 28 July 2008

A reader is part of an Importer

The RecordReaders, as they are actually called, transform the native data into an XML. Record Readers are configured via the ImporterConfig which will set certain settings before you can get an iterator for a passed file. What does that mean? Well, lets say that you have a really long text file where you have to break at each line starting with a BEGIN RECORD. You would need quite a lot of memmory to read the whole file especially when we need to convert it into a different character encoding. That's why you need to tell the RecordRedaer that you need to break at each of the BEGIN RECORD lines, hand it over to the Mapper and continue to read the file as soon as the mapper is done converting the record. This behaviour is called Iterator because we go through each record at a time. The RecordReaders create theses RecordIterators for each file you've uploaded to the application.

So faar, the application can handle the following native data and generate an XML out of it.


Contents

CsvRecordReader

The CsvRecordReader iterataes through each line of the supplied file and returns an XML with an element for each column. It takes the following settings:

Enclosure 
What character surrounds the value of a field in the CSV
Escape 
What character escapes the following character (which is needed to escape the enclosure for example)
Delimiter 
What character is used to split the line into the fields
FirstLineIsHeader 
Is the first line the header line, then thsi line will be used as attribute for the XML output

Iso2709recordReader

This Reader doesn't take any settings as it used the standard. It will create a MARC-XML out of the text file.

XmlRecordReader

SequentialRecordReader

SeparatedSequentialRecordReader

DatabaseRecordReader

Personal tools