How to convert a CSV file to 3D Text objects with Python? I want to take a simple CSV file and specify 2 rows then print them next to each other or below each other as separate objects:
eg. row 6 = NAME row 7 = TITLE



I am trying to read the list to reconstruct them as varying elements of a base title. I thought that I could place them on their own layers but I run out of layers quickly. So then I thought that I could allocate each pair to a series of frames or single frames to render.

Heres my text file

My code snippet reads out one row but I'm not sure how to iterate the rows and positions of each new row?

import bpy # THIS IS A MUST TO IMPORT ALL BLENDER PYTHON MODULE
import csv # IMPORT CSV MODULE

 # READ INPUT FILE

file = csv.reader(open('D:\daves\WBD\wbd filtered text', newline=''), delimiter=',')

curRow = [] #empty placeholder for current row

for idx, row in enumerate(file):
    if idx&lt;22: # this is hard coded but you can use

        curRow = row

        # display first data index as string
        bpy.ops.object.text_add(location=(0,idx,0), rotation=(0,0,0))
        bpy.ops.object.editmode_toggle()
        bpy.ops.font.delete()
        bpy.ops.font.text_insert(text=curRow[7], curRow[6])
        bpy.ops.object.editmode_toggle()
Try this:

import bpy # THIS IS A MUST TO IMPORT ALL BLENDER PYTHON MODULE
import csv # IMPORT CSV MODULE

# READ INPUT FILE

fp   = 'D:\daves\WBD\wbd filtered text'
file = csv.reader( open( fp, newline='' ), delimiter=',' )

nameIdx = 6 # Column index of text object's name
bodyIdx = 7 # Column index of text object's body (content)

for idx, row in enumerate( file ):
    if idx &lt; 22: # this is hard coded but you can use
        # display first data index as string
        bpy.ops.object.text_add(location=(0,idx*2,0), rotation=(0,0,0))

        # After the line above is executed, the added text object becomes
        # the active object, referenced as the bpy.context.object
        # 't' will become a shortcut variable to access this object
        t = bpy.context.object

        # Access and alter the text object's name
        # This will be reflected in the outliner and object properties panel
        t.name = row[ nameIdx ]

        # Often in blender, the 'data' property holds specitic data
        # related to the object's type. For instance, a polygonal mesh
        # object's data property hold data about vertices, edges and polygons
        # among other things.
        # A text object's data stores the "body" property, which is the
        # actual text content of the text object. In this line we are 
        # updating the text content, and assigning it the name, a newline
        # character and then the title.
        t.data.body = row[ nameIdx ] + "\n" + row[ bodyIdx ].upper() 


For simplicity's sake I combined the name and title to one text object (with a newline special character "\n" between them), but you can of course simply generate another text object and offset its position with a variation of this code.