I need to parse xlsx file on Linux from .NET Core Console application. However, I couldn't find any library for parsing Microsoft Office files that is supported by .NET Core 5 framework.
Asked
Active
Viewed 2.4k times
16
-
Would it be possible for you to work with CSV files rather than Excel spreadsheets, or is that out of the question? – Maritim Jan 19 '16 at 18:43
-
@Maritim I would of course rather use CSV file, but the input type is defined by our customer, so it can't be changed. – Štěpán Beneš Jan 19 '16 at 19:47
-
I don't suppose they can submit the data as CSV then? That's what I'd ask for at least, no point in sending an Excel file if a CSV can do the job ;) – Maritim Jan 19 '16 at 21:42
-
3May be try: https://github.com/VahidN/EPPlus.Core – nawfal Nov 01 '16 at 05:38
-
@ŠtěpánBeneš what did you end up using? – dyesdyes Jan 09 '17 at 17:05
-
2@dyesdyes I ended up using the EPPlus library which has an unofficial version [EPPlus.Core](https://github.com/VahidN/EPPlus.Core) that runs on .NET Core. http://www.talkingdotnet.com/import-export-xlsx-asp-net-core/ – Štěpán Beneš Jan 13 '17 at 14:13
-
@ŠtěpánBeneš I think you can add an answer yourself. I ended up using it and it works pretty well. – dyesdyes Jan 13 '17 at 14:19
2 Answers
6
Have you taken a look at Excel Data Reader?
There's also a NuGet package if that makes it easier to install.
The API project file doesn't appear to have any COM interop requirements with Office, which is further supported by the existence of Android and Silverlight compatible projects included in the library.

MutantNinjaCodeMonkey
- 1,239
- 9
- 14
-
Yes, I have tried to add reference to ExcelDataReader NuGet package, but it does not seem to support framework DNXCore, only full dot net framework. I have also taken look at NetOffice.Excel package, but it was the same. – Štěpán Beneš Jan 19 '16 at 19:53
-
1You may want to try from GitHub instead. NuGet's only as recent as the last build they published. I'm pretty sure I saw references to portable class types in GitHub. If that doesn't work straight away, you can try to recompile from source with just DNX Core. The .Net requirement might just be at the project level. And at the worst, you'll see what .Net classes you'll need to replace to get it to work. – MutantNinjaCodeMonkey Jan 19 '16 at 21:02
-
1@MutantNinjaCodeMonkey, It would not be possible because the library is referencing `ICSharpCode.SharpZipLib.dll` which does not have support for .NET Core – Nikolay Kostov Oct 24 '16 at 07:34
-
2
1
Another possibility would be to use Gnumeric and ssconvert to convert the incoming file temporarily to a csv.
You can write a command line wrapper around that to encapsulate the process.
Update: This SO post details how to use ssconvert (as well as a few other command line alternatives): Convert xlsx to csv in linux command line

Community
- 1
- 1

MutantNinjaCodeMonkey
- 1,239
- 9
- 14