Skip to content

Instantly share code, notes, and snippets.

@Someguy123
Last active September 20, 2016 04:34
Show Gist options
  • Save Someguy123/5013a479dea3ac8996d32642cfb902a6 to your computer and use it in GitHub Desktop.
Save Someguy123/5013a479dea3ac8996d32642cfb902a6 to your computer and use it in GitHub Desktop.
Extract only spent private keys from a BitAddress/LiteAddress text file
# This means to build an array () based on line breaks in the file
# allowing us to use it with a for loop
LFS='
'
# btcaddrs contains addresses that are actually used
addresses=($(cat btcaddrs.txt))
# filter the bitaddress file btc.txt to only contain used addresses
# then spit out the un-quoted private keys
(for a in $addresses; do grep $a btc.txt; done) | awk '{ split($0,a,","); print a[3] }' | tr -d '"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment