I have this script that allows me to change my text:
import bpy
## create an string with words copied from table
words = '''
txt 1
txt 2
txt 3
txt 4
'''
## split the string and select all except the first and the last because these spaces are empty
words_array = words.split("\n")[1:-1]
## print the array to verify that it is correct. Printed on the system console: "Window > Toogle System Console"
print(words_array)
## initialice an index to extract a word from array
index = 0
## loop through the selected text objects and assign them the corresponding word.
for textObject in bpy.context.selected_objects:
textObject.data.body = words_array[index]
index = index + 1
And it works fine as long as I keep each text on a different line,I want to bring the text from an excel sheet, each columns has 2-3 lines of text, is there a way to bring in the text with script keeping the lines as they are in an excel