private IndexEntry ParseMasterIndexLine(string line, int lineNumber, IEdgarFilesRepository repo) { //Example //1163302|UNITED STATES STEEL CORP|10-Q|2016-07-27|edgar/data/1163302/0001163302-16-000134.txt IndexEntry entry = new IndexEntry(); //entry.OriginalLine = line; string[] fields = line.Split('|'); entry.CIK = int.Parse(fields[0]); entry.Company = repo.GetRegistrant(entry.CIK, fields[1]); entry.CompanyName = fields[1]; entry.FormType = repo.GetSECForm(fields[2]); entry.FormTypeId = entry.FormType.Id; string format; if (fields[3].Length == 10) { format = "yyyy-MM-dd"; } else if (fields[3].Length == 8) { format = "yyyyMMdd"; } else { throw new InvalidFormatException($"Date of line {lineNumber} is not valid: {line}"); } entry.DateFiled = DateTime.ParseExact(fields[3], format, null); entry.RelativeURL = fields[4]; return(entry); }
public MasterIndexesParser(IEdgarWebClient webClient, IEdgarFileParser parser, IEdgarFilesRepository edgarFilesRepository, IEdgarFilesBulkRepository edgarFilesBulkRepository) { this.webClient = webClient; this.parser = parser; this.edgarFilesRepo = edgarFilesRepository; this.edgarFilesBulkRepo = edgarFilesBulkRepository; }
public EdgarFileParser(IEdgarFilesRepository repo) { this.edgarFileRepository = repo; }