Manipulation of Excel files in TwinCAT - xlsx

Is there an available library for reading/writing of Excel files, particularly XLSX or XLSM for TwinCAT 3? How about TDMS files? Obviously I'd prefer something open source and free, if available.
Thank you

Using TwinCAT you can make CSV files, JSON files, XML files.
Next, after write files, you can use Python language to save data as excel files.
There is some book for python called : "Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners"
There are some examples how to read write and modify Excel and Word files.
but remember that CSV can be opened in Excel using IMPORT or just using CTRL+C/CTRL+V. Delimiter in TwinCAT is located in Global variables - read about it in Beckhoff Information System (btw. google search works better and faster than Beckhoff's search on website)
info about CSV function blocks from this page:
https://infosys.beckhoff.com/content/1033/tcplclib_tc2_utilities/34977931.html?id=7903313200164417832
https://infosys.beckhoff.com/content/1033/tcplclib_tc2_utilities/34979467.html?id=1113952616781398655

Related

What is the difference between the libraries libxl and libxls? (I am trying to use them in c)

I recently wanted to read an excel file in c using libxl. While doing some searches I came with a term libxls. What is the difference between libxl and libxls?
As #CherryDT says, it is two different libraries developed by different people.
libxls will read .xls files
libxl will read .xls and .xlsx files

How to read an excel file created by Microsoft Excel by CH376 IC?

In my embedded system I am using a CH376 IC (PDF link) for file handling. I am able to detect a Flash Disk, but not able to read the excel file created by Microsoft Excel. The excel file is created on the PC and copied in the Flash Disk.
I want to create a database in an Excel file on PC and after creating it, I want to upload in to my embedded system for this I need read the file created.
Please help me to read the file.
The .xls and .xlsx file formats are both extremely complex. Parsing them is unlikely to be feasible in an embedded environment. (In particular, .xlsx is a PKZIP archive containing XML data -- you will need a minimum of 32 KB of SRAM just to decompress the file containing the cell data, and even more to parse it.)
Use a different file format. Consider using .csv, for instance -- it's just a text file, with one row of data on each line, so it's pretty straightforward to work with.

ms search text ifilter

I'm a newbie in MS Search so please forgive the dumb question :-)
I'm storing a large amount of specialized text files for a card game (bridge).
These files are plain textfiles with a specific format to describe a bridge game played in a championship.
The only difference with a regular .txt file is the file extension that is NOT ".txt" but ".lin"
What I need is implement a new iFilter that is an exact copy of the standard MS Search text iFilter, but with another file extension.
Is this possible by copy/pasting an existing filter and tweaking (tampering) its content?
Or do I have to use c# to edit the iFilter and recompile?
The Windows 7 SDK has a sample IFilter implementation that would be a good blue print for what you are trying to do. It contains a project called "SmpFilt" The code shows parsing of a text file with a custom file extension. You will need to modify the code to parse your text instead and pull out any custom attributes from your .lin files.
Unfortunately, you can no longer build custom IFilters with managed code (C#/VB, etc). The sample project is in c++. Windows 7 and Server 2008 won't load IFilters written in managed code.
Good luck.

File extension .DB - What kind of database is it exactly?

I have a database file with .DB file extension. I have been googling and it looks like SQLite. I tried to connect to it using SQLite and SQLite3 drivers and I am getting an error "File is encrypted or not a database".
So I dont know if file is encrypted or it is not an SQLite database. Are there any other options what should the .DB extension should be? How do I find out that file is encrypted?
I tried to open it in the text editor and it is mostly a mess of charaters and some times there are words visible. I have uploaded the file here: http://cl.ly/3k0E01373r3v182a3p1o for the closer look.
Thank you for your hints and ideas what to do and how to work with this file.
Marco Pontello's TrID is a great way to determine the type of any file.
TrID is simple to use. Just run TrID and point it to the file to be analyzed. The file will be read and compared with the definitions in the database. Results are presented in order of highest probability.
Just download the executable and the latest definitions file into the same directory and then run TrID:
trid.exe "path/to/file.xyz"
It will output a list of possible file types for the file with a confidence rating. Here's a screenshot of using TrID to analyze a SQLite database file:
There's also a GUI version called TrIDNet:
If you're on a Unix-like platform (Mac OS X, Linux, etc), you could try running file myfile.db to see if that can figure out what type of file it is. The file utility will inspect the beginning of the file, looking for any clues like magic numbers, headers, and so on to determine the type of the file.
Look at the first 30 bytes of the file (open it in Notepad, Notepad++ or another simple text viewer). There's usually some kind of tag or extension name in there.
Both SQLite 2 and SQLite 3 have a very clear message: SQLite format 3 for SQLite 3 (obviously) and This file contains an SQLite 2.1 database for SQLite 2.
Note that encrypted SQLite databases don't have a header like that since the entire file is encrypted. See siyw's comment below.
On a Unix-like system (or Cygwin under Windows), the strings utility will search a file for strings, and print them to stdout. Might help you narrow the field.
There are a lot of programs besides database programs that use a "db" extension, including
ArcView Object Database File (ESRI)
MultiEdit
Netscape
Palm
and so on. Google "file extensions" for some sites that catalog file extensions and the programs that use them.
There's no conclusive way to know, because SQLite encrypts the entire database file, including the header.
Further, there's not a lot of difference to you, except for possible error text to a user if you're prompting them for a password.

Open and read Excel from a Linux based C program?

I am trying to locate a set of source code that would allow me to open and read the contents of an Excel file on Linux from within a C program.
I dont really want to link it to OpenOffice SDK if I can find something that just does these two things.
carl
If following suites you, then You may take read routines from
Sourceforge
and write routines from
What is a simple and reliable C library for working with Excel files?
As far as I know there is no library that does this. The common method is always to save the file as CVS in Excel, although then markup etc. is lost.
You could try to use the Excel plugin of Gnumeric:
http://svn.gnome.org/viewvc/gnumeric/trunk/plugins/excel/
It works very well (inside gnumeric).
You can use xlhtml to convert the Excel files into HTML, and then use your favorite HTML parser to extract the cell data.
Check out the answers to What is the best C library that can access Excel files?
Possible things for you to look at:
C : xlsLib
C++ : LibExcel
Though I think both are write-only, which is perhaps not what you need.
Grab the xls reading code from Open Office.
why don't you just use Google Docs? With Gears it has offline support and you can edit files too, just a thought - http://docs.google.com
Check out XLSX I/O at https://sourceforge.net/projects/xlsxio/
It is a cross platform C library to read from and write to Excel .xslx files.
Works on Windows, OS X, Linux and does not require Excel or Office to be installed.
It is intended for sequential access to data in .xlsx files, so if it's only the values you are interested in this is what you need.

Resources