Unzip apparently split .gz, .sit or .tar archive - archive

We have an old dictionary software that seems to store the data in an SQLite database (an SQLite executable is shipped with the SW). We want to extract this database to create a machine learning database.
In the installed folder (on Windows), we found a folder named DB that seems to contain the database. It has the following files in it:
4096.gz
4096.sit
4096.tar
4097.gz
4097.sit
4097.tar
....
4129.gz
4129.sit
4129.tar
I cannot unpack any of them (on my Macbook), I tried the following commands (in all cases for the first and the last file):
tar -xvf 4129.tar --> tar: Unrecognized archive format.
gunzip 4129.gz --> gunzip: 4129.gz: not in gzip format.
used Stuffit (on MacOS) --> The StuffIt Engine was unable to determine the file format.
Unarchiver and archive utility did not work either.
So my question:
- Does anybody know/has seen somewhere the storage "format", which seems to come in three archive formats in parallel?
- What can I do to further investigate the formats? Or maybe they are encrypted?
- Does anybody have an idea how I could get the data?
Thanks a lot for the help!

Have you tried on the windows computer to use winrar or winzip? those applications should be able to open the .gz and .tar .
If this fails, those files are not those format. Maybe they have the extensions, but not really that content. The content could be arbitrary to the application and could use those extensions for "obfuscation".
As a way to verify, if you have a HEX editor check for the signature:
gz should start with 1F 8B
tar should start with 75 73 74 61 72 (ustar)
sqlite should start with 53 51 4c 69 74 65 (SQLite)
Look this wikipedia how to figure out the content of the file by the signatures: https://en.wikipedia.org/wiki/List_of_file_signatures
If your are sure that the application use SQLite, look for SQLite signatures.

Related

OpenEdge 10.2A - Generate database files using only .d1 and an old version of .db files

I have a .d1 file and an old version of .db file of the same database.
When I open .d1 file using a text editor, the content of the file is readible so it seems the database can be regenerated.
First, I have used only .d1 file and run the command under proenv:
prostrct builddb c:\db\myDb
the generated .db file only contains:
0020
string and nothing else, where as my standard .db files contains 640 KB data in each one.
I have tried to unlock my database using:
proutil unlock c:\db\myDb -extents
and pressed y for recovery question. And the output is:
** Database has the wrong version number. (db: 0, pro: 150). (44)
When I have put old .db file I have for the same database, and run the same command:
proutil unlock c:\db\myDb -extents
and pressed y for recovery question, the output is:
Database c:\db\myDb uses 32-bit dbkeys. It cannot be unlocked by this codebase. (13888)
Use the 10.1A prostrct utility to unlock this database. (13889)
I haven't seen the 10.1A version more than 10 years now and I'm pretty sure the version of the .d1 file is 10.2A.
If you direct me to the way to recover the database, it would be much appriciated.
If the .d1 file is truly 10.2a and you are using 10.2a to try to open it and the only thing missing is the .db file then you can properly recreate the .db file with:
prostrct builddb dbname
But if you are missing other critical files (such as the .b1 file) this will not work.
If you really only have the .d1 file then you almost certainly do not have enough pieces to work with.

SQLite3 using another hard drive for creating index

I have two hard disks: C (40GB capacity left) and D (1TB capacity left).
My sqlite folder (SQLite3 Windows download files from tutorial) is in disk D.
I created a database called myDatabase.db in the sqlite folder and have created a table in it and populated the table from a CSV file. This was done successfully as I ran a few queries and they worked.
The size of the database is quite large (50GB) and I want to create an index for my table. I do the CREATE INDEX command and it starts - it creates a myDatabase.db-journal file in the folder next to the .db file.
However, from "This PC" view of the hard drives I can see that disk C is getting drained (from 40GB, going 39 38 etc incrementally), myDatabase.db in drive D is not getting bigger.
I dont want SQLite to use C when it doesnt make sense for it do it as sqlite and .db file are in disk D.
Any suggestions why this is happening ?
Thanks in advance for your time.

Remove hex 1F from CSV file using Batch

I have multiple CSV files from different sites within my company that contain multiple names and email addresses from several SQL databases that many different company users enter data into. I have a SQL export program that exports the names and emails to CSV files. I have noticed that occasionally some of the email addresses have the hex 0x1F separator either before or after the email address (in Notepad++ it looks like a black "US" box).
How can I write a simple batch file to find and remove just that separator from any CSV file that may have it. And save the output using/replacing the original file. Preferably using simple batch commands, not Powershell or Java or anything else like that. This will be running on a standard install of Windows 2008 R2 without any extra programs added.
Example:
Directory:
C:\Uploads
Filenames (up to 23 files with a random 2 digit prefix followed by date):
"a1-20151101.csv", "b2-20151101.csv", "cd-20151101.csv", etc.
Inside CSV (FirstName;LastName;Email):
John;Doe;john.doe#johndoe.com
Jane;Smith;jsmith#google.com
You could spend precious time writing some 400-line behemoth of a cmd file.
Or you could simply go and get the tr program from GnuWin32 (ports of the popular UNIX tools to native Windows) which is perfectly suited to doing this sort of thing.
Then your batch file will basically consist of the line:
tr -d "\37" inputFile >outputFile
The tr program is contained within the coreutils package.

Running a batch file on Kid3 ID3 MP3 tagger

I finally gave up after 120 hours of not finding a .NET or javascript/jquery plugin that can read and write to a COMPRESSED custom user frame (TXXX) in ID3v2 MP3 audio file.
UltraID3Lib: cannot read or write COMPRESSED Frames (last updated 2009, author Mitchell S. Honnert fell off face of the earth).
ID3Lib-sharp: cannot read or write COMPRESSED Frames (last updated 2012)
JavaScript-ID3-Reader: can return bytes but it's mostly the wrong bytes. Cannot write anything.
I cannot use the multitudes of Node.js or PHP scripts for my project so they are out of the question.
The only code I found that can read and write compress frames is Kid3.
http://sourceforge.net/projects/kid3/
However, it is written in C (I don't know that) and uses third party frameworks since it was not built in windows. The Command program required 13MB of support dlls, QMs, and whatevers.
I have no choice at his point but to try and use it's separate command program kid3-cli.exe
So here's my question:
Here is the way to read a TXXX frame using the program at the command prompt.
"71F3-15-FOO58A77" is the name of the TXXX frame and the "2" gets the text value it holds:
cd "C:\mp3folder"
select "test.mp3"
get "71F3-15-FOO58A77" "2"
export "clipboard" "CSV unquoted" "2"
QUESTION: HOW DO I use a Batch file to run these commands?
According to kid3 documents. It shows using -c as grouped commands. Windows cmd (or the program) on windows does know what -c is.
Example: I double click the batch file and it should:
start the program
sent the program (not cmd) the above 4 lines
each must be executed separately.
Sounds simple, but I can't get it to even execute one of the programs code after starting.
Any ideas? and and can someone write a ID3 tag program that can read and write COMPRESSED TXXX tags without using node.js, PHP or a server in Windows.
I will buy them a beer because I'm really a (cheap) designer by trade and a pert-time programmer only when I have too.
Here is a zip file of a COMPRESSED TXXX Frame in test.mp3 to test:
[http://robbiestewart.ca/test.zip][1]
Download Kid3 and use its windows GUI (kid3.exe) to view the custom user frame (TXXX).
Run the included kid3-cli.exe to do the same at the command prompt.
Try to do the same in a batch file.
According to the help file, you should be able to use the command
kid3-cli -c 'cd "C:\mp3folder"' -c 'select "test.mp3"' -c 'get "71F3-15-F0058A77" "2"' -c 'export "clipboard" "CSV unquoted" "2"'
I ran it on the file you provided and seven tabs followed by 0:00.00 were put on my clipboard, but the value of the TXXX field indicated by the GUI was output to my command prompt.

windows command promt zip/compress directory

Is possible to compress/archive a directory with all of its sub-directories and files in a single file from cmd.exe ? I know there are a lot of utilities available but I need to perform the operation only with the windows default utilities . I'm running windows server 2003 .
Although the old makecab doesn't store a real directory structure, you can command the output directories for each file if you really need it. The procedure is more cumbersome than using a modern utility, but can be done.
For doing this you should create a .ddf file.
The manual for the old makecab has been removed from the web by MS. I found a copy here.
In page 33 of the makecab manual you will find:
DestinationDir=path
Path prefix to store in cabinet file for each file in the cabinet.
Default: .Set DestinationDir= ; Default is no path prefix
pathis concatenated with a path separator (“\”) and the target file name on
File Copy Commands to produce the file name that is stored in cabinet file.
EXTRACT.EXE will use this file name as the default name when the file is extracted.
Examples:
.Set DestinationDir=SYSTEM ; Following files get SYSTEM prefix
bin\ARIAL.TTF ; Name in cabinet is SYSTEM\ARIAL.TTF
.Set DestinationDir= ; No prefix
bin\ARIAL.TTF ; Name in cabinet is ARIAL.TTF
HTH!
There's really very little you can do as there's no command-line compression as part of Windows as standard.
The closest thing I can think of is to use the backup program NTBackup.
If there's any way you can install a utility I'd strongly recommend 7zip which I've had good experience of scripting with.

Resources