Author

Topic: batch private address dump and import in bash (Read 259 times)

legendary
Activity: 1456
Merit: 1000
Hi,

this is how i do batch private address extract and import, pls inform me if there something else that can improve this.

thanks


Quote
run coin-qt -server

============
dump priv key
============

./coind listaddressgroupings >> test.txt

awk '/"/' test.txt >btest.txt  #only print those between symbol

cat btest.txt | sed 's/"//g' >ctest.txt  #remove symbol

cat ctest.txt | sed 's/,//g' >dtest.txt #remove symbol

cat dtest.txt | sed 's/ //g' >etest.txt #remove space

awk '/./' etest.txt >> ftest.txt #remove empty


awk < ftest.txt '{ print "./coind dumpprivkey "  $1" " $2" " $3" " $4 }' | "/bin/sh"       >>privkey.txt

============
import privkey.txt
============

awk < privkey.txt '{ print "./coind importprivkey " $1" " $2" " $3" " $4 }' | "/bin/sh"       >privkey1.txt

Jump to: