Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. with open("workbook.csv") as f1:
  2.     with open("new_workbook.csv","w") as f2:
  3.         lines = f1.readlines()
  4.         for line in lines:
  5.             tab = line.split(";")
  6.             col1 = tab[0]
  7.             tab2 = tab[1].strip()[1:-1].split("\r")
  8.             for value in tab2:
  9.                 f2.write(col1 + ";" + value + "\n")
  10.  
  11.     print "done."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement