Most advice on importing csv files seems to assume users are on Windows, not Mac and many hours of effort has not helped this noobie to figure out the Mac setup and paths to import csv files to Blender text window. So I'm thinking just create a big string as below outside Blender and paste into Blender Python text window and then program a way to convert this string to a list(lines of data) of lists(variables). Does this make sense? Simple enough but somewhat defeatist!
CSV FILE 5 LINES
number,y,x,z,m
1,0,0.44,8.19,11.21
2,-11.68,8.13,8.31,7.22
3,-1.54,1.42,5.93,2.16
4,-7.1,3.13,6.25,1.42
5,5.17,3.13,8,1.39
(REAL DAT WILL BE 1000+ LINES)
MANUALLY CONVERT TO A LONG STRING
quakeTxt="1,0,0.44,8.19,11.212,-11.68,8.13,8.31,7.223,-1.54,1.42,5.93,2.164,-7.1,3.13,6.25,1.425,5.17,3.13,8,1.39"
PASTE INTO BLENDER
Because the script below doesn't work
import os
import bpy
blendPath = /Users/dickmeehan/Desktop
fileName = "xyzevents.csv" # name of the csv which is on Desktop
txt = open(blendPath + fileName, "r") # open the file to read
quakeTxt = txt.read() # read the entire file into a string
txt.close() # close the file
print(quakeTxt)
blendPath
will not work - at all. Strings need to be quoted. tryfilePath = r"/Users/dickmeehan/Desktop/xyzevents.csv"
$\endgroup$