# HG changeset patch # User Matti Hamalainen # Date 1531145454 -10800 # Node ID ef646bacfa993d7af2a2a4dbfe66eced483f1889 # Parent c0849f47e10f1c39081660fd8e20d9d6d97cabe1 Update examples. diff -r c0849f47e10f -r ef646bacfa99 README.txt --- a/README.txt Mon Jul 09 16:47:03 2018 +0300 +++ b/README.txt Mon Jul 09 17:10:54 2018 +0300 @@ -70,6 +70,8 @@ --- --- --- --- --- --- --- --- --- --- +Display all information about one file in "entry per row" format: + $ sidinfo /misc/C64Music/MUSICIANS/J/Jeff/Anal_ogue.sid Filename : /misc/C64Music/MUSICIANS/J/Jeff/Anal_ogue.sid Type : PSID @@ -88,6 +90,8 @@ --- --- --- --- --- --- --- --- --- --- +Display in "parseable" INI-style format, with hexadecimal values: + $ sidinfo /misc/C64Music/MUSICIANS/J/Jeff/Anal_ogue.sid -p -x Filename=/misc/C64Music/MUSICIANS/J/Jeff/Anal_ogue.sid Type=PSID @@ -106,13 +110,16 @@ --- --- --- --- --- --- --- --- --- --- +One-line format with "|" as field separator, and specify +which fields to display: + $ sidinfo -l \| -f type,ver,hash,name,author,copyright Anal_ogue.sid PSID|2.0|Anal'ogue|Søren Lund (Jeff)|1996 Jeff|6d5b7f0ff092e55abf27c37c8bc3fc64| --- --- --- --- --- --- --- --- --- --- -By using the format string functionality you can -control the output very specifically: +By using the format string functionality you can control +the output very specifically: $ sidinfo Anal_ogue.sid -F 'NAME="@name@"\nHASH=@hash@\n' NAME="Anal'ogue" @@ -120,6 +127,14 @@ --- --- --- --- --- --- --- --- --- --- +You could, for example create SQL INSERT statements: + +$ sidinfo Anal_ogue.sid -e\' -F "INSERT INTO sometable (filename,name,author) VALUES ('@filename@', '@name@', '@author@', '@copyright@')\n" + +INSERT INTO sometable (filename,name,author) VALUES ('./Anal_ogue.sid', 'Anal\'ogue', 'Søren Lund (Jeff)', '1996 Jeff') + +--- --- --- --- --- --- --- --- --- --- + Furthermore, you can use "printf"-style format specifiers for formatting each @field@, see this example: @@ -130,3 +145,17 @@ Many of the format specifiers are supported, but not all, and obviously only integer/string formats are supported. + +--- --- --- --- --- --- --- --- --- --- + +Since sidinfo v0.7.6 it is also possible to automatically scan +and recurse directories via '-R' option, for example: + +$ sidinfo -R /misc/C64Music/*.sid + +The above ill start from /misc/C64Music/ and scan any accessible subdirectories +for files that match "*.sid" pattern and handle them. + +Using previous example about SQL inserts: + +$ sidinfo /misc/C64Music/*.sid -R -e\' -F "INSERT INTO sometable (filename,name,author) VALUES ('@filename@', '@name@', '@author@', '@copyright@')\n"