```
nf=open(Output_File,'w+')
with open(Input_File,'read') as f:
    for row in f:
        Current_line = str(row)
        Reformated_line=str(','.join(Current_line.split('|')[1:-1]))
        nf.write(Reformated_line+ "\n")

```

I'm trying to read `Input file` which is in Table Format and write it in a CSV file, but my Output contains one last empty line also. How can I remove the last empty line in CSV?