I would like to know how to extract the cell value (numbers) from a specified spreadsheet of Excel using c++.
What I am trying to achieve is iterate an entire column by using a "for" loop
Thanks
(i am using xcode)
There are pretty lots of libraries you can try out
Pick the one that suits your need.
QtXlsx
The QtXlsx library (https://github.com/dbzhang800/QtXlsxWriter) is the most feature complete. It is, however, based on the Qt framework. Not suitable for low footprint application.
XLNT
xlnt (https://github.com/tfussell/xlnt) is a modern C++ library for manipulating spreadsheets in memory and reading/writing them from/to XLSX files as described in ECMA 376 4th edition.
libxls
The libxls library (https://sourceforge.net/projects/libxls/) is a C library for reading files in the legacy Excel file format, .xls. It cannot be used for writing or modifying Excel files.
xlslib
The xlslib library (https://sourceforge.net/projects/xlslib/) is a C/C++ library for creating files in the legacy Excel file format, .xls. It cannot be used for reading or modifying Excel files.
libxlsxwriter
The libxlsxwriter library (https://libxlsxwriter.github.io) is a C library for creating .xlsx files. It cannot be used for reading or modifying Excel files.
LibXL (not free)
The LibXL library (http://www.libxl.com) can read, write, create and modify Excel files, in both the .xls and .xlsx formats. It is the most feature complete library available and has interfaces for C, C++, C# and Delphi.
Related
I'm very new to using libraries for C++ and I have some doubts. I will need to work with medical images, MRI in particular, (DICOM format). I want to process those images - get the particular pixel values. However, as I read, I need some additional libraries to be able to work with DICOM file format in C++. I found VTK and ITK libraries. However, I'm not sure if it is libraries for c++... Does anyone know? DO I only need to download it, install and use it in my C++ code or is it a separate tool with GUI? Will I be able to read DICOM file formats and access its pixel values and manipulate it with C++?
Thanks
VTK and ITK are both open source C++ libraries.
I think the confusion might come from the VTK file source formats which can be vizualize by a GUI interface Paraview.
Kitwares propose several tools in medical imaging, data vizualization, which can be used "together" hence the confusion.
But you can consider VTK and ITK as C++ libraries.
ITK and VTK are libraries written in C++, so you can download the code, compile the libraries and link them with your C++ code. ITK supports reading and writing DICOM files, along with a host of there medical image formats. You will be able to access pixel values in your C++ code using ITK.
ITK and VTK are written in C ++.
But if you want somenter read DICOM files, recomento use only VTK.
VTK is responsible for data representation as part ITK will treat filter handling.
vtkDICOMImageReader is the recommended class for reading DICOM files (.dcm or .dir)
If you choose to use VTK and ITK, will have to activate the function itkvtkglue
I was searching for some ways to read .pdf files and I wasn't able to get anything from it, I would probably need a library but all the options I found is very confusing and hard to deal with.
I was wondering which way would be the best way for me to do this task, which is to search through the .pdf and get the content in the Abstract section of it. (which is text)
The easiest and cheapest is using an open source library which is popular and known to other programmers.
Before trying to write your own PDF reader from scratch, take look at these:
Parsing:
PoDoFo
The PoDoFo library is a free, portable C++ library which includes
classes to parse PDF files and modify their contents into memory. The
changes can be written back to disk easily. The parser can also be
used to extract information from a PDF file (for example the parser
could be used in a PDF viewer). Besides parsing PoDoFo includes also
very simple classes to create your own PDF files. All classes are
documented so it is easy to start writing your own application using
PoDoFo.
Generating:
LibHaru
Haru is a free, cross platform, open-sourced software library for
generating PDF written in ANSI-C. It can work as both a static-library
(.a, .lib) and a shared-library (.so, .dll).
panda
A PDF generation API written in C
I've searched a lot of info, about the easiest way to create and edit excel files to save some login and passwords of my program. I've seen lots of C# methods and I don't understand it a lot.
I've added a reference to Visual Studio 2010 Microsoft.Office.Interop.Excel (I'm using Office 2010).
I don't know how to take this further, however; what headers should I add, what else should I do? I can't find any tutorial of C++ using this on their projects. I just want something simple.
EDIT:
I will run my program on a pc that has Office 2010 installed.
read these
http://support.microsoft.com/kb/216686/en-us?fr=1
http://www.codeguru.com/cpp/data/mfc_database/microsoftexcel/article.php/c11745/Microsoft-Excel-Automation-Class.htm
Does the system where your application will run on have Excel installed or not?
If it does, you can use indeed use Excel as a COM component. https://learn.microsoft.com/en-us/previous-versions/office/troubleshoot/office-developer/automate-excel-from-c contains an example on how to do this.
If your system does not have Excel installed, you need to use a 3rd party library to create the Excel files for you. Just Google for "create excel files without excel" and you will find dozens of example code.
I have a question how can I use wxSqlLite in my wxWidgets applications? I downloaded wxSqlite3 for wxWidgets 2.9x and build it but only static win32 debug win32 and static win32 release win32 compiled without errors. How can I add wxSqllite to my project? My ide is visual c++ 2008.
You don't NEED to use wxSQLite. You can simply call the SQLite API directly from your code. It takes an hour or two to get familiar with the API, but then it does everything you need without worrying about linking your build to yet another package.
The SQLite API is a library. There are several ways you can 'install' it. I have noticed that the SQLite site is a bit vague on this question. Here is what I do.
Download the zip containing the prebuilt DLL from http://sqlite.org/sqlite-dll-win32-x86-3071000.zip
This will give you the DLL, which should go in the folder where your executable runs.
This will also give the the export deefinition file ( .def ). This has to be converted to a .lib file so that it can be linked to. You do this using the lib utility.
You also need the sqlite3.h header file, which is included in the amalgamation downloaded from http://sqlite.org/sqlite-amalgamation-3071000.zip
If all this seems like a lot of trouble, you can alternatively use the amalgamation. Simply download the amalgamation and add the two files to your project. The downside with this is that you will have to build the SQLite code over and over again,slowing your build process, and the entire code will be statically linked to every executable. Nowadays builds run on modern computers so quickly that the cost of using the amalgamation is well worth the gain in simplicity. These days, I never use the DLL.
Of course one could use the SQLite API directly as ravenspoint pointed out, but wxSQLite3 makes it easier to integrate SQLite databases with wxWidgets-based C++ applications. The wxSQLite3 API is similar to JDBC and ODBC. wxSQLite3 takes care of converting wxString objects to and from UTF-8, one of the 2 encodings (UTF-8 or UTF-16) expected by SQLite; wxSQLite3 supports creating user defined functions as C++ classes; and adds several other features like backup and restore of databases, value collections, support for different date and time value representations and so on. wxSQLite3 can load the SQLite DLL at runtime without requiring a link library if you prefer, it's just setting a compile time flag.
Adding wxSQLite3 to a project is simple: either create a DLL or static library using the build files (including VC++ 2008 solution) coming with wxSQLite3, or just add the single C++ source file and few header files to your own project.
In case of difficulties ask your questions on the wxWidgets developer forum.
Continuation of:
Standalone Cross Platform (Windows/Linux)) File Compression for C/C++?
After many attempts on ZLIB ZZLIB LIBZIP MINIZIP I always get many problems at the compilation stage. Many google searches turned out OS-specific libraries and I can't really find anything that fit my 'simple' needs.
I reduced my needs for the library (Or wrapper?) to this:
Works on both Windows and Linux OR 2 separate libraries; one which works on Windows and the other one on Linux, I can make 2 separate projects for Windows and Linux if it is really neccesary
Unpack file from zip to specified directory
Check if file exists in zip file
C OR C++ OR Mixed (yeah, that doesn't matter)
Preferably Very Simple to include into any project
(eg 5 c/cpp files and 1-3 header files? anyway not tons files, when I open all the libzip and zlib archives I have something like: "O my ..")
I've checked many stackoveflow threads too with the words "Windows Linux ZIP C C++" but all the results seem so have libraries which I OR don't know how to compile OR is too difficult to use OR it has too many 'needed stuff' for just simple zip extract and check if file exists.
I had put that project away for a later date and begun it now, and all those compilation errors came up (especially that VC++2010 doesn't have the C-99 inttypes.h)
I have had very good experience with Zipstream C++ library which gives you a nice OOP way of handling zip files.
If your project already uses some of the bigger libs like Boost , then you could try to use the boost::iostreams with the gzip filter, however the functionality is somehow limited.
Or if you happen to use Poco take a look at they're implementation Poco::Zip