Closed noorani786 closed 6 years ago
Given how unreliable feed responses have been, wondering if it is better to just read the file line-by-line and then pass it over to CSV.parse_line with begin..rescue?
Figured out the issue on this one. Here is the proposed fix:
peddler/flat_file_parser.rb
def extract_content_and_summary
@content = body.encode('UTF-8', invalid: :replace, undef: :replace)
parts = @content.split("\n\n") if @content.include?("\n\n")
@summary = parts[0]
@content = parts[1..parts.length-1].join()
end
Thanks for reporting and explaining the bug, @noorani786. I'll push a fix to master.
See attached file containing response from MWS. Parsing stops after 95 rows because of the extra newline characters.
FeedType submitted: _POST_FLAT_FILE_INVLOADERDATA
jacob_report.csv.zip