csvTableToHtml
#roshanb79
def convertToHtml(filename,sep):
tbody=[]
with open(filename,"r") as f:
for line in f.readlines():
tbody.append(line.split(sep))
htmlcode="<table>"
for tr in tbody:
htmlcode+="<tr>"
for td in tr:
htmlcode+=f"<td>{td}</td>"
htmlcode+="</tr>"
htmlcode+="</table>"
print(htmlcode)
sep=input("Input Your Column Seperator")
convertToHtml("table.csv",sep)
Chal bhaag nhi karunga
ReplyDelete