How to view 'data' file which is included by .odb database file? - database

I am trying to extract the data from .odb database file. For this, at first I unzipped the .odb file and then tried to read 'data' file came from this unzipped. But I guess there is an encoding problem during the reading process. I get some meaningless symbols. As far I search, this file could be a binary file. By the way, I can not see the extension of the 'data' file. I wonder how to read file to exract data?

i'm brazilian, and i saw this question without a answer.
i'm python user and i did this:
try to open the file that contains database *.odb
___________________________a file.py________________________
import sys, zipfile
myfile = zipfile.ZipFile(yourfile.odb)
listoffiles = myfile.infolist()
for s in listoffiles:
if s.orig_filename == "database/data":
print(bh.decode("utf-8", "ignore"))
____________________________eof_________________________________
my table is very simple, but it may help.
I've found this jointing parts from several websites.
as you see, an odb file is simply a zipped file that contains a xml file that contains a table information "content.xml" but only table information.
the content of database is in database/data. the values are stored here. you can decode with decode on python.
thanks to http://www.linuxjournal.com/ too, were i found some scripts

Related

How to Import Just The FileName into SQL via SSIS

I am trying to write a file name to a table in my database - at the moment all I am achieving is importing the whole file path.
I have a foreach loop, which on the Collection looks in a specific folder and for a specific file type (the retrieve file name is fully qualified)
This has a variable mapping to "ImportInvoiceFilePath"
Then within that is a Data Flow Task which includes the flat file source, a derived column which creates the file path in the database.
This works fine - but what I am trying really hard to do but can't work out is how do I get just the file name (no extension) to write to the database as well?
Literally worked it out. Set my forloop to nameonly then in my connection to my Source file under expressions put:
#[User::ProcessingInvoiceFilePath] + "\\"+#[User::ImportInvoiceFileName]+".saf"
Where saf is the file type

My sql file contains nonsense content

I have an sql file which was being used for SQLServer, my problem is that when I open the file it contains nothing but nonsense like so:
Iک}d9ے(csيIط)ص\‡)dٹ2_ئO§(µïu.=‹i’BWىأï¹1³ف™hىbژ/‚w&ح‚îِ†“zْàˆIQT)”edC¦e³´
¹ط!‎إ-Œ¤{^#.œ£HE÷ھ¸ٌqqœoة_`T‍kذم.°t/قژط½¾إé„t¾%م¶كىظq،f29ؤ
ھَl¤iٌ¾gi›¶¯ک3»«sـ°“c^r#^ـآg›çAچ/إ/±aNüط
Could you help me how I can fix it please?
It might be binary data.
Check if there is any BLOB column.

using pg_read_file read file in desktop PostgreSQL

I wanted to how to read a file in my desk top using pg_read_file in PostgreSQL
pg_read_file(filename text [, offset bigint, length bigint])
my query
select pg_read_file('/root/desktop/new.txt' , 0 , 1000000);
error
ERROR: absolute path not allowed
UPDATE
pg_read_file can read the files only from the data directory path, if you would like to know your data directory path use:
SHOW data_directory;
I think that you can resolve you problem by looking to this post
If you're using psql you can use \lo_import to create a large object from a local file.
The pg_read_file tool only allows reads from server-side files.
To read the content of a file from PostgreSQL you can use this.
CREATE TABLE demo(t text);
COPY demo from '[FILENAME]';
SELECT * FROM demo;
Each text-line in a SQL-ROW. Useful for temporary transfers.
lo_import(file path) will generate an oid.This may solve your problem. you can import any type of file using this (even image)

components of an SPSS project

I have given some data in an excel sheet to a 3rd party for SPSS data processing. After completion of the processing, what are the files that I should get back from them.
I have received one file with a ".sav" extension. I presume this file contains the imported data (from my excel file).
I have received documents (.rtf - rich text format) with the chart and graphs only. Is there something else I need to get so that I can use the files later on for further analysis.
Thanks in advance
V Karthick
Yes, the ".sav" extension is the data file. You should also request the syntax file(s), ".sps" extension. The syntax file is a record of all data transformations which have been performed and allows you to review their work. The syntax file can be opened with notepad or any text editor.
Arthur

Read a value from a .xls file using .bat files

I just want to know if there could be any way by which we can read a value from an .xls file using a .bat file.
For eg:If i have an .xls named test.xls which is having two columns
namely 'EID' and then 'mail ID'.Now when we give the input to the .xls the EID name.it should extract the mail id which corresponds to the EID and echo the result out.
**EID** **MailID**
E22222 MynameisA#company.com
E33333 MynameisB#company.com
...
...
So by the above table,when i give the input to the xls file using my .bat file as E22222,it should read the corresponding mail ID as MynameisA#company.com and it should echo the value.
So i hope i am able to present my doubt.Please get back to me for more clarifications.
Thanks and regards
Maddy
There is no facility to do this directly with traditional .bat files. However, you might investigate PowerShell, which is designed to be able to do this sort of thing. PowerShell integrates well with existing Windows applications (such as Excel) and may provide the tools you need to do this easily.
A quick search turned up this example of reading Excel files from PowerShell.
You can't do this directly from a batch file. Furthermore, to manipulate use Excel files in scripting you need Excel to be installed.
What you can do is wrap the Excel-specific stuff in a VBScript and call that from your batch.
You can do it with Alacon - command-line utility for Alasql database.
It works with Node.js, so you need to install Node.js and then Alasql package:
To take data from Excel file you can use the following command:
> node alacon "SELECT VALUE [mail ID] FROM XLS('mydata.xls', {headers:true})
WHERE EID = ?" "E2222"
Fist parameter is a SQL-expresion, which read data from XLSX file with header and search data
for second parameter value: "E22222". The command returns mail ID value.
This will be hard (very close to impossible) in BAT, especially when using the original XLS file, but even after an export to CSV it will be much easier to use a script/programming language (Perl, C, whatever) to do this.

Resources