Hi all.
Library is working almost normally, but there is a problem.
If you try to handle large files (larger than 200 megabytes), an error occurs in module FileMARC.cs
/ / Foreach (string record in source.Split (END_OF_RECORD))
/ / {
/ / / / Make sure the record isn't empty, or isn't the end of a file
/ / If (record! = String.Empty && record! = "\ X1A")
/ / {
/ / / / Split removes the END_OF_RECORD. Put it back in
/ / This.rawSource.Add (record END_OF_RECORD.ToString ());
/ /}
/ /}
/ /}
Probably worth adding to alter records on the block
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This should be fixed in the latest release through the use of the FileMARCReader class.
string filename = "manyrecords.mrc";
FileMARCReader reader = new FileMARCReader(filename);
int target = 100;
foreach (Record marc in reader)
{
//Use the record object as you normally would
}
reader.Dispose();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all.
Library is working almost normally, but there is a problem.
If you try to handle large files (larger than 200 megabytes), an error occurs in module FileMARC.cs
/ / public void Add (string source)
/ / {
/ / Source = CleanSource (source);
/ / Foreach (string record in source.Split (END_OF_RECORD))
/ / {
/ / / / Make sure the record isn't empty, or isn't the end of a file
/ / If (record! = String.Empty && record! = "\ X1A")
/ / {
/ / / / Split removes the END_OF_RECORD. Put it back in
/ / This.rawSource.Add (record END_OF_RECORD.ToString ());
/ /}
/ /}
/ /}
Probably worth adding to alter records on the block
Thanks for the report. I'll look into how I'm handling larger files and see if I can come up with a solution.
This should be fixed in the latest release through the use of the FileMARCReader class.
string filename = "manyrecords.mrc";
FileMARCReader reader = new FileMARCReader(filename);
int target = 100;
foreach (Record marc in reader)
{
//Use the record object as you normally would
}
reader.Dispose();