❔ What is the recommended way to read excel(*.xlsx) files?
in .NET Framework 4.8. I don't need any info of fonts, colors, styles, or anything else; i only need the texts i get when i convert excel into CSV. thanks!
20 Replies
Is it possible for you to work with something else than .xlsx? I've had more problems with the format and ingestion than any other format.
what i've done is converting the .xlsx file into .csv and reading the csv files. i'm looking for some ways to automate the converting process
You can try using EPPLus: https://github.com/EPPlusSoftware/EPPlus
GitHub
GitHub - EPPlusSoftware/EPPlus: EPPlus-Excel spreadsheets for .NET
EPPlus-Excel spreadsheets for .NET. Contribute to EPPlusSoftware/EPPlus development by creating an account on GitHub.
There are export options, which includes
ToText
https://github.com/EPPlusSoftware/EPPlus/wiki/Export-dataGitHub
Export data
EPPlus-Excel spreadsheets for .NET. Contribute to EPPlusSoftware/EPPlus development by creating an account on GitHub.
But mind that there are some license changes since v6, but for most of the tasks v5 will be enough
ive had success reading
.docx
files by opening them as zip files, you can try the same with .xlsx
@한우 I maintain a couple libraries that make .xlsx => .csv about as easy as it can get: https://github.com/MarkPflug/Sylvan.Data.Excel#converting-excel-data-to-csvs
GitHub
GitHub - MarkPflug/Sylvan.Data.Excel: The fastest .NET library for ...
The fastest .NET library for reading Excel data files. - GitHub - MarkPflug/Sylvan.Data.Excel: The fastest .NET library for reading Excel data files.
it looks really cool but i'm currently developing on .NET 4.8
thanks anyways
I'd happily provide code for that if you'd like. Do you have excel installed?
yup
Perfect, now this code is not generally recommend as it can be slow, but here's a example on how you do it using Excel
If you're looking for speed, I'd recommend Open XML SDK. They work on xlsx files. Here's an example.
Both of those methods work on 4.8, tried and tested.
wow, thanks!
Yeah man. Enjoy.
hmm one question. i'm gonna publish (i already did, actually) the program. then will user be have to have excel installed in their computers?
The top one yes, the open xml? No.
thanks!
Yep. Anytime.
Uh, it supports netstandard 2.0, which covers .NET 4.8. Did you try it?
oh i didn't notice that
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.