Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data_positions = [1,51,151,153,155,175,225,275,325,375,425,426,427,437,487,489,539,589,639,640,690,740,742,792,794, ...]
- csv_file = open("stream.csv", "r")
- data = csv_file.read()
- rows = data.split('n')
- stream_data = []
- for e in rows:
- split_e = e.split(",")
- stream_data.append(split_e)
- for line in stream_data:
- for i in line:
- print (i)
- #Open and clear file for writing new values
- file = open("stream.txt", "r+")
- file.truncate()
- file.close()
- file = open("stream.txt", "w")
- for line in stream_data:
- for i in range(0,len(line)):
- file.seek(data_positions[i]-1)
- file.write(line[i])
- file.write("n")
- file.close()
Add Comment
Please, Sign In to add comment