Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #Set the directory where the file is available
  2. os.chdir('C:\\Users\\pedroalejandro.tavar\\Desktop')
  3.  
  4. #infile is the data and outfile contains the output file name's
  5. infile = "coma_file.txt"
  6. outfile = "tab_file.txt"
  7.  
  8. with open(infile, "r") as infile1:
  9. with open(outfile, "w") as outfile1:
  10. for line in infile1:
  11. fields = line.strip().split(",")
  12. outfile1.write("\t".join(fields))
  13. outfile1.write("\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement