Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Table from a CSV

  • Posted by Matthew Belinkie on March 23, 2022 at 2:52 pm

    Hi guys. I want to import a CSV and create a nicely-formatted table. I understand how to pickwhip a text layer’s source text property to one particular piece of data in the CSV. However, I want to get the whole column into a single text layer. So let’s say the first column of my CSV is years, 2000 to 2022. How can I get a text layer filled with a vertical list of all those years, using one expression? Bonus: I’d like to add two sliders, “row offset” and “number of rows” that allow me to specify which rows are brought in.

    If I could get this working for one text layer then I could do other text layers for the other columns, pulling the same rows. Then all I have to do is create formulas that space everything out nicely.

    Thanks.

    Matthew Belinkie replied 4 years, 1 month ago 3 Members · 3 Replies
  • 3 Replies
  • Chris Voelz

    March 23, 2022 at 4:04 pm

    You’ll just have to assemble the data into a single text layer.

    row1 = footage("your.csv").dataValue([0,0]);
    row2 = footage("your.csv").dataValue([0,1]);
    row3 = footage("your.csv").dataValue([0,2]);
    row4 = footage("your.csv").dataValue([0,3]);
    row5 = footage("your.csv").dataValue([0,4]);
    row1 + "\r" + row2 + "\r" + row3 + "\r" + row4 + "\r" + row5 //"\r" adds a return

    If you want a slider to control the offset you can just use it’s data in dataValue.

    rowoffset = effect("Slider Control")("Slider");
    row1 = footage("your.csv").dataValue([1,0 + rowoffset]);
    row2 = footage("your.csv").dataValue([1,1 + rowoffset]);
    row3 = footage("your.csv").dataValue([1,2 + rowoffset]);
    row1 + "\r" + row2 + "\r" + row3

    Row offset is easier than controlling the number of rows. That would be a harder task since you would need to anticipate all the different values. Is it going to be 1 row or 100? No mater what you would need to code all those variables.

    numrows = effect("Slider Control")("Slider");
    rowoffset = effect("Slider Control")("Slider");
    row1 = footage("your.csv").dataValue([1,0 + rowoffset]);
    row2 = footage("your.csv").dataValue([1,1 + rowoffset]);
    row3 = footage("your.csv").dataValue([1,2 + rowoffset]);
    R1 = row1;
    R2 = row1 + "\r" + row2;
    R3 = row1 + "\r" + row2 + "\r" + row3;
    if (numrows == 1) {R1}
    else if (numrows == 2) {R2}
    else {R3}
  • Filip Vandueren

    March 23, 2022 at 4:40 pm

    https://aescripts.com/express-table/

    seems like your ticket.

  • Matthew Belinkie

    March 24, 2022 at 1:08 am

    Thank you! I’ll see if I can make this work.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy