import pandas as pd
import os
def text_to_unicode(text):
if pd.isna(text):
return ""
return ",".join(str(ord(ch)) for ch in str(text))
excel_path = "/Users/apple/Downloads/دانلودها/پارسال-فیک- دریا پلنر copy/events with line toolani.xlsx"
#input("Excel file path: ").strip()
df = pd.read_excel(excel_path)
output_path = os.path.splitext(excel_path)[0] + "_output213.txt"
with open(output_path, "w", encoding="utf-8") as f:
for _, row in df.iterrows():
day = int(row.iloc[0])
month = int(row.iloc[1])
title = text_to_unicode(row.iloc[2])
holiday = int(row.iloc[3])
extra = int(row.iloc[4])
line = f"{day},{month},{title},{holiday},{extra}"
f.write(line + "\n")
print("Done.")
print(output_path)