From 6d7bd5aee19415f9533466a61b9a64976a990687 Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Mon, 3 Jun 2019 23:02:17 +0300 Subject: [PATCH] Ignore malformed csv lines --- .../QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs index e6bb1fd..dc218b5 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs @@ -46,7 +46,9 @@ namespace QuickLook.Plugin.CsvViewer using (var sr = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))) { - using (var parser = new CsvParser(sr)) + var conf = new CsvHelper.Configuration.Configuration() {MissingFieldFound = null, BadDataFound = null}; + + using (var parser = new CsvParser(sr, conf)) { var i = 0; while (true)