On Mon, 26 Aug 2013 20:01:08 +0200
Clemens Ladisch <[email protected]> wrote:
> sqlite3 database.db "UPDATE table1 SET column3 = CAST(x'$(hexdump -v
> -e '1/1 "%02x"' file.xml)' AS TEXT) WHERE column1 = 'some name';"
$ hexdump -C input
00000000 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f | !"#$%&'()*+,-./|
00000010 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f |0123456789:;<=>?|
00000020 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f |@ABCDEFGHIJKLMNO|
00000030 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f |PQRSTUVWXYZ[\]^_|
00000040 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f |`abcdefghijklmno|
00000050 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e |pqrstuvwxyz{|}~|
0000005f
$ DATA=$(sed "s/[']/&&/g" input)
$ sqlite3 db "select '${DATA}' as alphabet;"
alphabet
---------------------------------------------------------------------------------------------
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
^_`abcdefghijklmnopqrstuvwxyz{|}~
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users