Parsing .csv and .txt files in FPMI

You can use straight Python file handling, here is an example for a csv file:[code]file = open(‘c:\file.csv’, ‘r’)

for line in file.readlines():
data = line.split(",")
num1 = data[0]
num2 = data[1]
num3 = data[2]
print num1, num2, num3[/code]That will read a multi-line csv file. If you want to read just one line remove the loop and just do line = file.readlines(). The line.split will split the line on some character. If you wanted a tab instead do “\t”.