I need to get data from a csv (text) file.
I only need to read one piece of data from the csv file.
I am using Python in Blender 2.79 to control the movement of a model using data from the csv file.
CSV FILE:
Line5=58,5,0.5,77.5,1,,,,,,10
Line6=51,5,12,85,1,0,0,,0,1.5,10
Line7=89,0,0,,,,,,,,10
Line8=13,5,29.0,,,,,,,,10
Example - I need to read the second number on the top line (5).
Then convert it to a number so I can use it to move my model by that amount.
See below, this is what I have tried so far but it reads the second number from all the lines and I can not use it to create a single variable.
import csv
data = open(path+"TL3.txt", "r")
reader = csv.reader(data, delimiter=',')
next(reader)
row = data.readlines()
for row in reader:
print(row[1])
data.close()
Any help is greatly received. (I would not like to say how long I have been searching for an answer to this)
Sean
I only need to read one piece of data from the csv file.
I am using Python in Blender 2.79 to control the movement of a model using data from the csv file.
CSV FILE:
Line5=58,5,0.5,77.5,1,,,,,,10
Line6=51,5,12,85,1,0,0,,0,1.5,10
Line7=89,0,0,,,,,,,,10
Line8=13,5,29.0,,,,,,,,10
Example - I need to read the second number on the top line (5).
Then convert it to a number so I can use it to move my model by that amount.
See below, this is what I have tried so far but it reads the second number from all the lines and I can not use it to create a single variable.
import csv
data = open(path+"TL3.txt", "r")
reader = csv.reader(data, delimiter=',')
next(reader)
row = data.readlines()
for row in reader:
print(row[1])
data.close()
Quote:
Any help is greatly received. (I would not like to say how long I have been searching for an answer to this)
Sean