C
C#14mo ago
Livid

✅ Excel

how do i read a excel file / table
35 Replies
Jimmacle
Jimmacle14mo ago
$excel
MODiX
MODiX14mo ago
ClosedXML 0.102.1
See release notes https://github.com/ClosedXML/ClosedXML/releases/tag/0.102.1 ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.
Livid
LividOP14mo ago
i can't use that
Jimmacle
Jimmacle14mo ago
ok without information i can't give a good suggestion
Livid
LividOP14mo ago
i can't have references in my project
Jimmacle
Jimmacle14mo ago
why? because basically any excel editing/interop is going to be a library you need to reference you are talking about .xlsx files, right? not csv/tsv/some other plaintext format?
Livid
LividOP14mo ago
yes xlsx
Jimmacle
Jimmacle14mo ago
so you need to reference a library unless you plan on implementing your own XLSX manipulation library (which is a terrible idea)
Livid
LividOP14mo ago
i only really need to read contents
Jimmacle
Jimmacle14mo ago
you still need code that understands the file format so your options are to write it or use someone else's what is the reason you can't have references?
Livid
LividOP14mo ago
the program i'm using doesn't support it
Jimmacle
Jimmacle14mo ago
aren't you writing the program? please provide enough detail in your question that we can help you
Livid
LividOP14mo ago
need to read a excel file - but can't use references / libary
Jimmacle
Jimmacle14mo ago
you're kinda out of luck then
MarkPflug
MarkPflug14mo ago
ClosedXML is MIT open source. If you "can't have references" then you can copy all the source code into your project. But, that would also be idiotic if you can use it a nuget package reference instead.
Jimmacle
Jimmacle14mo ago
i feel like "can't have references" suggests there is a lot more context that isn't being shared
MarkPflug
MarkPflug14mo ago
Indeed. Or the questioner is trying to obscure something in their work.
Jimmacle
Jimmacle14mo ago
well, until that context is given there's nothing else we can suggest
MarkPflug
MarkPflug14mo ago
Anyway... the answer to "how to read an .xlsx" is fully "described" by any number of open source libraries: ClosedXml, ExcelDataReader, NPOI, MiniExcel, FastExcel, Sylvan.Data.Excel (the one I wrote), or one of many others.
MarkPflug
MarkPflug14mo ago
How easy they are to use is up to you to decide, but I've measured the performance of most of them: https://github.com/MarkPflug/Benchmarks/blob/main/docs/ExcelReaderBenchmarks.md#excel-xlsx-benchmarks
GitHub
Benchmarks/docs/ExcelReaderBenchmarks.md at main · MarkPflug/Benchm...
Benchmarks for various .NET libraries. Contribute to MarkPflug/Benchmarks development by creating an account on GitHub.
Livid
LividOP14mo ago
what more context?
Jimmacle
Jimmacle14mo ago
i've asked several times why can't you use libraries?
Livid
LividOP14mo ago
the application i'm using doesn't support it
Jimmacle
Jimmacle14mo ago
you already said that what application? how does your code interact with it?
Livid
LividOP14mo ago
hmm wait so i can't install anything into my project
Jimmacle
Jimmacle14mo ago
but why? i'm trying to help you find solutions here, make it easy for me
Livid
LividOP14mo ago
yes sorry
Livid
LividOP14mo ago
these are the only options for my project :(
No description
Jimmacle
Jimmacle14mo ago
what application is this?
Livid
LividOP14mo ago
company's
Jimmacle
Jimmacle14mo ago
your company has a custom in-house IDE?
Livid
LividOP14mo ago
yes
Jimmacle
Jimmacle14mo ago
i guess you're out of luck then your best option would be to copy and paste the source code from a library that permits that kind of usage like MarkPflug suggested or ask someone at your company for help
GaSkia
GaSkia14mo ago
Have u added the assembly? Can u send the using part with the error
Jimmacle
Jimmacle14mo ago
read above, he's using some special editor his company made that doesn't allow project/assembly references
Want results from more Discord servers?
Add your server