Remove illegal characters

This commit is contained in:
Mike Phares 2023-05-23 11:18:49 -07:00
parent 1dba5fcfa4
commit f66393e27e

View File

@ -325,13 +325,8 @@ public partial class ProcessData
// Example: "Cassette 47-241330-4238 started."
segments = line.Substring(9).Split(new string[] { "started" }, StringSplitOptions.RemoveEmptyEntries);
if (segments.Any())
{
// Detected a new cassette scan in the raw source file
cassetteID = segments[0].Trim();
cassetteID = cassetteID.Replace(":", string.Empty);
cassetteID = cassetteID.Replace("*", string.Empty);
cassetteID = cassetteID.Replace("\\", string.Empty);
}
// Remove illegal characters \/:*?"<>| found in the Cassette.
cassetteID = Regex.Replace(segments[0].Trim(), @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
}
}
// Continue reading and saving the cassette scan information, into the cassette