def main(file, file_b):
with open(file, 'r', encoding="utf-8") as enter_id_file:
file_content = enter_id_file.read().replace(",", "=").replace("-","").replace(" ","").splitlines()
autpoot = []
for line in file_content:
number_colan = line.split("=")
if number_colan[0].isdigit() and 11 > len(number_colan[0]) > 8 and number_colan[1] !="":
number = "".join([number_colan[0] if number_colan[0].startswith("0") else "0" + number_colan[0],"=",number_colan[1]])
autpoot.append(number)
elif number_colan[1].isdigit() and 11 > len(number_colan[1]) > 8 and number_colan[0] !="":
number = "".join([number_colan[1] if number_colan[1].startswith("0") else "0" + number_colan[1],"=",number_colan[0]])
autpoot.append(number)
processed_ini = '\n'.join(autpoot)
with open(file_b, 'w', encoding="utf-8") as f:
f.write(processed_ini)
file = "1.csv"
file_b = "EnterIDValName.ini"
main(file, file_b)
לקובץ שמיוצא מאנשי קשר גוגל צריך לשנות בשורה 2 את
encoding="utf-8"
ל
encoding="windows-1255"
צריך לוודא שהנתונים [שם, טלפון] נמצאים בעמודה 1 ו2 ושהקובץ הוא בפורמט csv