Hi.
many thanks for the answers!
I have a program where I make 'readable' marc-files, using Marc4j.
Its small code:
#############
public static void main (String[] args) throws IOException{
InputStream in = null;
Record record = null;
File marc = new File("/data/marcdaten/exdat_ubt_test5.readable");
try {
marc.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
FileOutputStream out = new FileOutputStream(marc);
OutputStreamWriter schreibeStrom = new OutputStreamWriter(out);
BufferedWriter bw = new BufferedWriter(schreibeStrom);
try {
in = new FileInputStream("/data/marcdaten/rds/exdat_ubt_test5.mrc");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
MarcReader reader = new MarcStreamReader(in);
while (reader.hasNext()) {
record = reader.next();
//System.out.println(record.toString());
bw.write(record.toString());
}
bw.close();
#############
I downloaded marc4j-2.5.1.beta.jar and now I get the following error:
LEADER 00226cu a2200121ui 4500
001 04792582
003 DE-21
004 20070987
005 20111221000000.0
008 110621||||||||||||||||ger|||||||
852 $aW
852 1$a290$cZA 10093
938 $zL
Exception in thread "main" org.marc4j.MarcException: unable to parse record length
at org.marc4j.MarcStreamReader.parseRecordLength(MarcStreamReader.java:351)
at org.marc4j.MarcStreamReader.next(MarcStreamReader.java:138)
at marc4opac.MakeMrcReadable.start(MakeMrcReadable.java:63)
at marc4opac.Starter.main(Starter.java:63)
Caused by: java.lang.NumberFormatException: For input string: "
0022"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:470)
at java.lang.Integer.parseInt(Integer.java:514)
at org.marc4j.MarcStreamReader.parseRecordLength(MarcStreamReader.java:349)
... 3 more
...
Robert.
We have different installations. One for our productive Catalogue, where we use an old Solrmarc .
This installation will replace next year, so we don't want to change anything.
And a new Test-Installation with VuFind and the newest SolrMarc and Solr. (we managed it :-) (this will be productive next year)
You are right, when I try to index the data with line-feed with the VuFind installation there a no errors.
But my own programs for loading marc-data in the database, or making marc-files 'readable' don't work.
But if as you say: "CR and LF are not allowed according to the spec" , I
can tell this to our provider, so he has to give us valid Marc21 files.
Hannah Ullrich