Advertisement
Guest User

nums.py

a guest
May 15th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. from sys import stdin, stdout
  3.  
  4. value = None
  5. for line in stdin:
  6.     if line.startswith("t="):
  7.         value = int(line[2:]) / 1000.0
  8.         break
  9. if value:
  10.     stdout.write("{0},\n".format(value))
  11.  
  12. # On linux (untested): "cat foo|python nums.py >>data.csv"
  13. # On windows: "type foo.txt|python nums.py >>data.csv"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement