MMDB-lookup - a command line lookup tool for MMapDB databases
MMDB-lookup [OPTIONS] database-file key ...
Options can be abbreviated.
Normally only the data value is printed for each data record. If -v is specified the sorting field and the record id are also printed.
-v
Prints a brief help message and exits.
Prints the manual page and exits.
The first non-option is interpreted as database filename. All subsequent parameters form a key to be looked up. If the lookup results in an index the whole subtree starting with the index is printed. If the key is ommitted the whole database is dumped.
MMDB-lookup dumps MMapDB databases either completely or partly.
MMDB-lookup
Example 1:
$ MMDB-lookup transconfig.mmdb actn opi /hangman [[actn, opi, /hangman]] ==> [[File: '/Documents/hangman.svg', Done]]
Here the database transconfig.mmdb has been looked up for the key actn opi /hangman. Two data records have been found. Their values are File: '/Documents/hangman.svg' and Done.
transconfig.mmdb
actn opi /hangman
File: '/Documents/hangman.svg'
Done
Example 2:
$ MMDB-lookup x.mmdb Tschechien 6 1-2 F [[Tschechien, 6, 1-2, F, di]] ==> [[6, 10, 27, 35, 48, 88, 90, 94]] [[Tschechien, 6, 1-2, F, do]] ==> [[1, 6, 27, 88, 94]] [[Tschechien, 6, 1-2, F, fr]] ==> [[1, 6, 10, 27, 48, 88, 90, 94]] [[Tschechien, 6, 1-2, F, mi]] ==> [[1, 10, 27, 35, 88]] [[Tschechien, 6, 1-2, F, mo]] ==> [[88, 90, 94]] [[Tschechien, 6, 1-2, F, sa]] ==> [[10, 88]] [[Tschechien, 6, 1-2, F, so]] ==> [[1, 6, 10, 27, 32, 48, 90, 94]]
In this example the passed key resolves to an index. Hence, the whole subtree is dumped.
Example 3:
$ MMDB-lookup -v x.mmdb Tschechien 6 1-2 F sa [[Tschechien, 6, 1-2, F, sa]] ==> [[[SORTA 7076 10], [SORTB 58834 88]]]
This example is to demonstrate the --verbose option. Additionally to the data values 10 and 88 that can be found also in example 2 their sorting field and record IDs are shown.
--verbose
10
88
MMapDB
To install MMapDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MMapDB
CPAN shell
perl -MCPAN -e shell install MMapDB
For more information on module installation, please visit the detailed CPAN module installation guide.