{"action":"created","issue":{"url":"https://api.github.com/repos/ExcelDataReader/ExcelDataReader/issues/368","repository_url":"https://api.github.com/repos/ExcelDataReader/ExcelDataReader","labels_url":"https://api.github.com/repos/ExcelDataReader/ExcelDataReader/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/ExcelDataReader/ExcelDataReader/issues/368/comments","events_url":"https://api.github.com/repos/ExcelDataReader/ExcelDataReader/issues/368/events","html_url":"https://github.com/ExcelDataReader/ExcelDataReader/issues/368","id":381151359,"node_id":"MDU6SXNzdWUzODExNTEzNTk=","number":368,"title":"Unable to load XLS file - \"Invalid file signature\" (CreateReader) / Garbage data (CSV)","user":{"login":"ktox","id":26175066,"node_id":"MDQ6VXNlcjI2MTc1MDY2","avatar_url":"https://avatars2.githubusercontent.com/u/26175066?v=4","gravatar_id":"","url":"https://api.github.com/users/ktox","html_url":"https://github.com/ktox","followers_url":"https://api.github.com/users/ktox/followers","following_url":"https://api.github.com/users/ktox/following{/other_user}","gists_url":"https://api.github.com/users/ktox/gists{/gist_id}","starred_url":"https://api.github.com/users/ktox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktox/subscriptions","organizations_url":"https://api.github.com/users/ktox/orgs","repos_url":"https://api.github.com/users/ktox/repos","events_url":"https://api.github.com/users/ktox/events{/privacy}","received_events_url":"https://api.github.com/users/ktox/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-15T13:02:18Z","updated_at":"2018-11-15T14:59:52Z","closed_at":null,"author_association":"NONE","body":"Greetings.\r\n\r\nFirst of all, let me thank you for this nice piece of code -- apart from this particular case, it just works with any other file I tried, without the need for an OleDb provider.\r\n\r\nNow, onto this one:\r\nI have this \"xls\" file I need to parse, whose origin I do not know, that fails whether I load it using CreateReader or CreateCsvReader.\r\nCreateReader -> \"Invalid file signature\" Exception\r\nCreateCsvReader -> It \"loads\" the file, but the row/column data is either empty or pure garbage (I guess that's to be expected, since the file _is not_ a CSV).\r\n\r\nThese are the file's first bytes (Big Endian), with the text on the 3rd row being the first cell (header's first column):\r\n![imagen](https://user-images.githubusercontent.com/26175066/48553106-65d74280-e8b9-11e8-8eea-7eade875be1b.png)\r\n\r\nThis is the code I'm using, which works for other files but not this one:\r\n```csharp\r\nusing (var stream = File.Open(path, FileMode.Open, FileAccess.Read))  \r\n{  \r\n\tstream.Seek(0L, SeekOrigin.Begin);  \r\n\tusing (var reader = ExcelReaderFactory.CreateReader(stream, new ExcelReaderConfiguration() { FallbackEncoding = System.Text.Encoding.GetEncoding(1252) }))  \r\n\t{  \r\n\t\tvar ds = reader.AsDataSet(new ExcelDataSetConfiguration()  \r\n\t\t{  \r\n\t\t\tUseColumnDataType = false,  \r\n\t\t\tConfigureDataTable = (tableReader) => new ExcelDataTableConfiguration() { UseHeaderRow = true }  \r\n\t\t}).Tables[0];  \r\n\t}  \r\n}\r\n```\r\n\r\nThe reason I tried setting up the FallbackEncoding for 1252 (which, if I'm not mistaken is already the default value) is because all this time we have been using a python script with the following piece of code, in order to \"convert\" those files into \"proper\" xls ones:  \r\n```python\r\nw = open_workbook(path, encoding_override=\"cp1252\")     # xlrd package\r\nwc = copy(w)\r\nwc.get_sheet(0).name = file[:-4]\r\nwc.save(path)\r\n```\r\n\r\nAlso, Excel 2010 and Interop.Excel 14 both open the file correcty as-is, yet I can't rely on Interop and can't save any edits on the file either -- Excel forces me to save on a native format.\r\n\r\nAny help would be greatly appreciated!\r\n\r\nRegards."},"comment":{"url":"https://api.github.com/repos/ExcelDataReader/ExcelDataReader/issues/comments/439069312","html_url":"https://github.com/ExcelDataReader/ExcelDataReader/issues/368#issuecomment-439069312","issue_url":"https://api.github.com/repos/ExcelDataReader/ExcelDataReader/issues/368","id":439069312,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTA2OTMxMg==","user":{"login":"ktox","id":26175066,"node_id":"MDQ6VXNlcjI2MTc1MDY2","avatar_url":"https://avatars2.githubusercontent.com/u/26175066?v=4","gravatar_id":"","url":"https://api.github.com/users/ktox","html_url":"https://github.com/ktox","followers_url":"https://api.github.com/users/ktox/followers","following_url":"https://api.github.com/users/ktox/following{/other_user}","gists_url":"https://api.github.com/users/ktox/gists{/gist_id}","starred_url":"https://api.github.com/users/ktox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktox/subscriptions","organizations_url":"https://api.github.com/users/ktox/orgs","repos_url":"https://api.github.com/users/ktox/repos","events_url":"https://api.github.com/users/ktox/events{/privacy}","received_events_url":"https://api.github.com/users/ktox/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T14:59:52Z","updated_at":"2018-11-15T14:59:52Z","author_association":"NONE","body":"This is what I get from Excel 2010:\r\n![imagen](https://user-images.githubusercontent.com/26175066/48559353-3da40f80-e8ca-11e8-9a99-f1f8a689029c.png)\r\n\r\n![imagen](https://user-images.githubusercontent.com/26175066/48559574-a4c1c400-e8ca-11e8-9121-aec8246c6367.png)\r\n\r\nThis is Save As... dialog just as it opens:\r\n![imagen](https://user-images.githubusercontent.com/26175066/48559643-c1f69280-e8ca-11e8-906b-b231a7348e79.png)\r\n\r\nMaybe it's got to do with that \"Excel 2 Worksheets\" filetype?\r\n\r\nThanks!"}}
{"actor":{"display_login":"ktox"}}