import os
file1 = open("C:\Users\kimi_\OneDrive\Desktop\Puzzle\sample1.txt","r")
file2 = open("C:\Users\kimi_\OneDrive\Desktop\Puzzle\sample1.txt","r")
file3 = open('Sample3.bat', "w")
file3.write("@echo [off]" + '\n')
for line in file1:
file3.write(line)
for line in file2:
file3.write(line)
file3.write(""KeyHunt-Cuda -m address --coin btc --range" + " + for line in file1 + " ":" " + for line in file2 + "" 13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so'\n'")
file1.close()
file2.close()
file3.close()
Any Python pro here can help me with this dirty simple code but I just couldn't solve it.
File1 = Start Range
File2 = End Range
File3 = Batch File
I have a long starting range in File1 and ending range in File2. I hope to use some python coding to create automatically for a batch file to search. For example, Line 1 in File 1 is A123000 and File 2 is A123FFF. So I want to create starting range of File 1 line 1 and ending range File 2 line 1, output in File3 batch file. I think it's pretty easy for pro python out there but I really not good in coding. Thanks in advance.
data = data2 = "";
# Reading data from file1
with open('sample1.txt') as fp:
data = fp.read()
# Reading data from file2
with open('sample2.txt') as fp:
data2 = fp.read()
# Merging 2 files
# To add the data of file2
# from next line
with open ('sample3.bat', 'a') as fp:
fp.write("@echo [off]" + '\n')
fp.writelines("KeyHunt-Cuda -m address --coin btc --range " + data + ":" + data2 + "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so" '\n')
Can someone help to look at what did I do wrong because the output as below?
@echo [off]
KeyHunt-Cuda -m address --coin btc --range aaaa
bbbb
cccc:ddd
eee
fff13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so
File 1
aaaa
bbbb
cccc
File 2
ddd
eee
fff
I hope to get an output of KeyHunt-Cuda -m address --coin btc --range aaaa:ddd 13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so
Anyone can teach me a solution on how to code it?
I already found the answer. Thanks anyway.