public SeparatedValueRecordParser(RetryReader reader, SeparatedValueOptions options) { this.reader = reader; this.options = options.Clone(); this.separatorMatcher = SeparatorMatcher.GetMatcher(reader, options.Separator); this.recordSeparatorMatcher = SeparatorMatcher.GetMatcher(reader, options.RecordSeparator); if (options.RecordSeparator != null && options.RecordSeparator.StartsWith(options.Separator)) { string postfix = options.RecordSeparator.Substring(options.Separator.Length); this.postfixMatcher = SeparatorMatcher.GetMatcher(reader, postfix); } this.separatorLength = Math.Max(this.options.RecordSeparator?.Length ?? 2, this.options.Separator.Length); this.tokens = new List <string>(); this.token = new StringBuilder(); }
public SeparatorRecordReader(TextReader reader, string separator) { this.reader = new RetryReader(reader); this.matcher = SeparatorMatcher.GetMatcher(this.reader, separator); this.builder = new StringBuilder(); }