-
Accessing first row of external csv via the 'footage' object?
Hi, I’m using footage.dataValue() to dynamically change all text in my project using expressions in text layers. The source of the text is a CSV file with language names (i.e. ‘English’ ‘French’ etc) in the first row and then each row after that includes a string of text for each AE text layer. So each column is a different language translation.
I can access the CSV fine and adjust all the text to correct languages, but one thing I just can’t figure out – is how to access the very first row of the CSV, which in my case is the language names.
I don’t want to include the csv into the comp as the file name will change multiple times and I’m using a utility comp to define the file name to use. So my option is to use footage.dataValue(), more specifically:
footage(comp(“Utility”).layer(“Filename”).text.sourceText).dataValue([0,0]);
But unfortunately, that value gives me the 2nd line of the CSV file, not the first. If I include the CSV into the comp, I can access the first row with this:
thisComp.layer(“TXT Translation doc CT_v2 TEST.csv”)(“Data”)(“Outline”)([1])
But this means every time the file is changed, I would either have to replace the existing in the project panel, or change it in the comp.
Is there any way to access the first row of an external csv, using the footage object?