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)

Comments

Post a Comment

Popular posts from this blog

ONE TO ONE CHAT APP