OpenTBS - pb merging xlsx - xlsx

I'd like to merge a xlsx file with data from a MySQL dB. I am not very comfortable with programming in general but I have already wrote some codes in PHP using TBS.
Anyway, I decided to start from the demo file (demo_ms_excel.php) that is corretly running on my server. Thant I just modified this file to put an include with all the data required for the dB connexion and when I re-test the demo file, Excel refuses to open the generated file (Impossible to open "demo_ms_excel_2020-04-10-9.xlsx" because its format or extension is not valid ...(translated from french)). Do you have any clue ? Can it be a format problem from my code editor (PSPad)) ?
Thanks for helping...

Related

Manipulation of Excel files in TwinCAT

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

ePub mimetype - anyone encountered a situation where it's needed?

I'm wondering if anyone has ever encountered a situation where it was necessary that the mimetype file be put into the zip file first (and uncompressed) to make the ePub work. And I'm not talking about the ability to pass an ePub validation.
I've been trying to write a script to create ePubs and it's not working. I tried several variations of the 7zip flags and every time the validation complains about the mimetype file.
I got fed up and just opened one of the files in Digital Editions and it worked fine. Then opened it in Calibre, dropped it into Chrome (ePub Reader), in iBooks, and even made a Kindle file. Everything worked as expected without throwing up an error.
Is there any situation where this matters...apart from the OCD part of me wanting an error-free file?
The answer appears to be "no"...
But here are a sampling of posts fighting with the Mimetype file error:
Make MIMETYPE file the first file in an EPUB ZIP file?
Creating an Epub file with a Zip library
creating *.epub with perl Archive::Zip -- epubchecker error
How to create ePub with System.IO.Compression.ZipArchive?
The mimetype file has an extra field of length n. The use of the extra field feature of the ZIP format is not permitted for the mimetype file

Extract cab file and use the database

I found an old windows mobile dictionary application and I want to get the database. I extract it but I don't know how to convert it to csv or sql file. Have anybody idea about it ?
You can download the file from here http://www.mediafire.com/download/z32xgmc9fia3nr2/OGD.Akilli.Sozluk.CAB
And I use Ubuntu.
SQLite makes available the C source code to compile a shell program which can be used to do this. It's apparently also included by Ubuntu. Here is the man page for the sqlite shell included with Ubuntu. Please review the documentation as there are a few ways to convert to CSV or get the schema of a table.
Alternatively, you can use a 3rd party tool to view the database in a GUI. I can't speak for Linux solutions, but Firefox has a 3rd party plugin called "SQLite Manager" that will let you use SQLite files in a GUI if you prefer it that way.

Exporting silverlight datagrid to excel file without warning message

The xls file opens fine and the data is correct but each time I open the file, the warning:
"The file you are trying to open, [filename] is in a different format... Verify that the file is not corrupted..."
pops up. I've read that there is no cleaner workaround to this except tweaking the registry/group policy to 'suppress' the message. But then, this doesn't appear on real xls files made from excel.
So is there a way/format that excel will open the file without this warning message? Should exporting the datagrid to xml/csv work?
found the answer same day, forgot to post the answer as soon as I got it working.
Here's a handy library to help create and read excel files properly. Works on SL4 but you could just tweak the source code to make it usable in SL3
http://excellite.codeplex.com/

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.

Resources