I have a file in .ods format,
How to access that file in vb.net?,which connection string i have to use? and
how to convert that .ods file to .xls file? i used file.copy function,the extension of filename is changed to .xls,but the Save as type of filename won't change,any solution is there programatically.
which converter format,i have to use for converting .ods to .xls file?
The only practical way of converting a .ods file into a .xls file is to open it in a spreadsheet program that supports reading ODF files and writing to Microsoft's (proprietary) Excel format. All you have to do is open it and resave it in the desired format. OpenOffice can kinda do this well, but any spreadsheets with more than a little complexity (contains graphs, functions other than the basic ones like SUM, etc) can be fouled up. There is, however, a plug-in for MS Office for reading and writing ODF files, and it may even be built in now. There are also drop through converters, but I have never used them.
Very late but you can use this one:
http://www.gemboxsoftware.com/support/articles/convert-xls-xlsx-ods-csv-html-net
Related
When writing to a binary file, when should I use .bin vs .dat? If I'm just trying to store information not meant to be read by humans, like item description/serial number pair, does it matter which one I pick if I'm just trying to make it unreadable from a text editor?
Let me give you some brief details about these files :
.BIN File : The BIN file type is primarily associated with 'Binary File'. Binary files are used for a wide variety of content and can be associated with a great many different programs. In general, a .BIN file will look like garbage when viewed in a file editor.
.DAT File : The DAT file type is primarily associated with 'Data'. Can be just about anything: text, graphic, or general binary data. Data file in special format or ASCII.
Reference:
Abhijit Banerjee answered that question on quora
.dat is a more frequently used suffix for binary data. It doesn't matter what extension you pick, as long as you are on Unix or Linux based systems.
Sufixes can mean whatever you want them to mean... Those rules are more like guidelines than actual rules...
However, BIN seems like a short to binary, so a BIN file will likely hold data in binary form. DAT seems like a short to data, so a DAT file will contain information in whatever format the developer of the program that reads that file seems fit (ASCII, Binary, a mix of them, something else entirely)
On a UNIX system, there is no difference. The extensions are interchangeable.
If you do not put any extension, it makes it kinda hard for someone not knowing what the file's extension should be, to open the file. Additionally, with Unix or Linux, if you place a dot (period) before the file name, the file hides itself.
I have a binary file (.bin) and a (.txt) file.
Using Python3, is there any way to combine these two files into one file (WITHOUT using any compressor tool if possible)?
And if I have to use a compressor, I want to do this with python.
As an example, I have 'file.txt' and 'file.bin', I want a library that gets these two and gives me one file, and also be able to un-merge the file.
Thank you
Just create a tar archive, a module that let's you accomplish this task is already bundled with Cpython, and it's called tarfile.
more examples here.
there are a lot of solutions for compressing!
gzip or zlib would allows compression and decompression and could be a solution for your problem.
Example of how to GZIP compress an existing file from [http://docs.python.org]:
import gzip
f_in = open('file.txt', 'rb')
f_out = gzip.open('file.txt.gz', 'wb')
f_out.writelines(f_in)
f_out.close()
f_in.close()
but also tarfile is a good solution!
Tar's the best solution to get binary file.
If you want the output to be a text, you can use base64 to transform binary file into a text data, then concatenate them into one file (using some unique string (or other technique) to mark the point they were merged).
I am currently taking a curse in C programming, and for our final project we need to read some text from a pdf into a string, so we can manipulate the string.
In essence what i am looking for is something similar to this, only with a .pdf instead of a .txt file.
char *line;
fscanf(myfile.txt," %[^\n]", line);
I have no experience with ghostscript, so I have no idea if this is even possible, although we where told that we should use ghostscript.
The current version of Ghostscript includes the 'txtwrite' device, which will extract text from any supported input (PostScript, PDF, XPS, PCL) and will emit it in a variety of forms.
The UTF-8 output would probably be most useful to you.
Caveat! Many things which appear to be text in PDF files are not text, and no attempt is made to deal with these.
ps2ascii is deprecated with the release of the txtwrite device, but in any case its perfectly capable (despite the name) of dealing with PDF as an input.
I can't think why anyone assigned you this project, PDF files are not text files, and cannot be treated as such. In addition to the fact that PDF files are generally compressed, identifying the contents stream and all the other streams it relies on (which may themselves include text) is non-trivial. Plus, the text is often encoded in a way which can be difficult to understand (this is particularly true of CIDFonts and TrueType fonts).
Perhaps your tutor expected you to first become expert in the PDF format, but that seems excessive for a C course.
You can convert your PDF to Postscript using pdf2ps, and then to ASCII using ps2ascii. You already know how to read ASCII.
Both utilities mentioned are in the ghostscript package.
I heard that it is a sqlite table just zipped up, but I cannot find anyway to open it up and access it contents. The file I'm needing to crack open is a book, and it's filename is book.zbook...
If you have any ideas, let me know please!
I've never worked with zbook files before, but I do have a fair bit of experience with "just compressed" file formats and SQLite and you're in luck. They could've been using the commercial SQLite Compressed and Encrypted Read-Only Database (CEROD) extension, but they're not.
.zbook is an SQLite3 database packed by raw zlib compression. (Gzip without a header, basically)
Here's some minimal code to unpack it in Python:
import zlib
infile = open('AntiguoTestamento.zbook', 'rb')
outfile = open('AntiguoTestamento.sqlite3', 'wb')
outfile.write(zlib.decompress(infile.read()))
infile.close()
outfile.close()
I'm actually a bit surprised at that. "Just zipped up" usually means the base format of the file is XML or HTML or something custom like bytecode or binary blobs since SQLite isn't really designed to be loaded from an archive that way.
I have a number of files that contain data in a format I am not familiar with. All of the data files begin with the same byte sequence, presumably a file header, and the sequence is "URES". I'm assuming that these files are some kind of resource file, perhaps a collection of data or other files all embedded into one file; that's just a guess however.
Does anyone know what format this is/might be?
If so, how would I interrogate the file? Are there applications that let me open these kind of files? Do you know of any libraries or APIs that I can use to gain programmatic access the data?
Have you tried running the unix file command on it?
I know of one file format that starts with URES. It's a data file used for Watchtower Library. I have yet to understand the format myself.
maybe its something from the Universal Resource Editor (URE) that comes with the OS/2 Toolkit? just a guess...
it is from the watchtower library files and they use meps to encode it which is thier own librarys and encryption software so to crack it would take you a long time.