Skip to main content
Participant
October 6, 2025
Question

How to source all the names from a .csv file into multiple text layers?

  • October 6, 2025
  • 1 reply
  • 129 views

Hello, I have a project where I need to showcase multiple rows of names, hundreds of thousands of them, scrolling through a long 15K x 2K resolution screen. These names are going to be sourced from a spreadsheet (I believe sales force), converted into a .csv file. 

 

They don't need to be animated, I was planning to just manually keyframe the scrolling motion myself. I just need each row of names to be connected to their own individual text layer. I found an expression that allows me to take a single text layer and populate all the names in a single column of .csv file: 

 

var filename = "[file-name].csv";
var column_index = 0;
var numberOfRows = thisComp.layer(filename)("Data")("Number of Rows");
var textString = "";

for (var i = 0; i < numberOfRows; i++) {
    var cellValue = footage(filename).dataValue([column_index, i]); 
textString = textString + cellValue + "   ";
}
text.sourceText = textString;

 

But how do I adjust this expression so that I can use this one .csv file to connect mutliple text layers. I'm assuming I'll need to create multiple columns in the spread sheet?

 

Here's a screenshot of what I'm looking to achieve as well as a sample .csv file. 

1 reply

RobBarrett
Community Expert
Community Expert
October 6, 2025

Hi @lushie17 , that's correct, it would be easiest to create multiple columns in your spreadsheet.

 

Given that you said you want a text layer per row, rather than per column, I would create as many text layers as you want rows, naming them "Row 1", "Row 2", etc.

 

In the Source Text for each layer, you can set the following expression. Whatever you put into join() is what will separate the names on each line – in this case, multiple space characters.

const rowNum = name.split("Row ")[1] - 1;
const csvData = thisComp.layer("names.tsv")("Data")("Outline");
const names = [];
names.push(csvData("column1")("column1 " + rowNum));
names.push(csvData("column2")("column2 " + rowNum));
names.push(csvData("column3")("column3 " + rowNum));
names.join("      ")

This pulls the row number from the layer's name, creates an array of all names from that row, and then combines them into a single text string.

 

However, given that you said that this will be hundreds of thousands of names, you might want to split these into columns, rather than rows. For this, you would instead create a text layer per column (named "Column 1", "Column 2", etc.), and could use the following expression:

const columnNum = name.split("Column ")[1];
const rowTotal = thisComp.layer("names.csv")("Data")("Number of Rows");
const csvData = thisComp.layer("names.csv")("Data")("Outline");
const names = [];
for (var i=0; i < rowTotal; i++) {
	names.push(csvData("column" + columnNum)("column" + columnNum + " " + i));
};
names.join("\n")

That checks the number of rows, and loops through, adding each one to an array, which is then converted to a single text string with a line break between each name.

 

Hope that helps.