System.arraycopy(args, 1, newArgs, 0, args.length-1);
args = newArgs;
}
String fileStr = args[0];
File file = new File(fileStr);
MarcReader readerNormal = null;
MarcReader readerPermissive = null;
boolean to_utf_8 = true;
InputStream inNorm;
InputStream inPerm;
OutputStream patchedRecStream = null;
MarcWriter patchedRecs = null;
ErrorHandler errorHandler = new ErrorHandler();
try
{
inNorm = new FileInputStream(file);
readerNormal = new MarcPermissiveStreamReader(inNorm, false, to_utf_8);
inPerm = new FileInputStream(file);
readerPermissive = new MarcPermissiveStreamReader(inPerm, errorHandler, to_utf_8, "BESTGUESS");
}
catch (FileNotFoundException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
if (args.length > 1)
{
try
{
patchedRecStream = new FileOutputStream(new File(args[1]));
patchedRecs = new MarcStreamWriter(patchedRecStream);
}
catch (FileNotFoundException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
while (readerNormal.hasNext() && readerPermissive.hasNext())
{
Record recNorm;
Record recPerm;
recPerm = readerPermissive.next();
String strPerm = recPerm.toString();
try {
recNorm = readerNormal.next();
}
catch (MarcException me)