Hmm... well using the -o option to output to a file you could then pull out just the "privkey" lines with findstr.
So from a cmd shell:
C:\Program Files\Bitcoin>vanitygen -q -o x 1AB
C:\Program Files\Bitcoin>findstr "Privkey: " x > xx
The tricky bit is not now do a "search/replace" to turn the following:
C:\Program Files\Bitcoin>type xx
Privkey: 5J9eh7Fwwbji4L45xsLT4FskJWb7spJx1YekagS1vAdTAiHMwWX
Privkey: 5J2kSNfhhPzMdceaBbBxGdKaGmEDosFEYNVTpHcCKjTGo4UutZM
Privkey: 5KXbbBZjmv4TqnJttrhGy7tSWp8thDkesayyCCm1Ss3ZM9N8v3F
into something that looks like this:
C:\Program Files\Bitcoin>type xx
bitcoind -rpcpassword=password importprivkey 5J9eh7Fwwbji4L45xsLT4FskJWb7spJx1YekagS1vAdTAiHMwWX
bitcoind -rpcpassword=password importprivkey 5J2kSNfhhPzMdceaBbBxGdKaGmEDosFEYNVTpHcCKjTGo4UutZM
bitcoind -rpcpassword=password importprivkey 5KXbbBZjmv4TqnJttrhGy7tSWp8thDkesayyCCm1Ss3ZM9N8v3F
I'm not sure if newer versions of Windows have some sort of
sed equivalent but from previous work I have the following .vbs script:
C:\Program Files\Bitcoin>type findrep.vbs
Const ForReading = 1
Const ForWriting = 2
If Wscript.Arguments.Count > 2 Then
strFileName = Wscript.Arguments(0)
strOldText = Wscript.Arguments(1)
strNewText = Wscript.Arguments(2)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, strOldText, strNewText)
Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.WriteLine strNewText
objFile.Close
Else
Wscript.Echo "Usage: findrep <file> <findstr> <replace>"
Wscript.Quit
End If
So you can use that to convert xx with the following:
findrep xx "Privkey:" "bitcoind -rpcpassword=password importprivkey"
Unfortunately it still doesn't give the empty quotes and "false" at the end of each line (to use the patched command) although for testing purposes you could always change the command to not do the scan by default.