Activity › Forums › Adobe After Effects › Map coordinates pulled from excel?
-
Tom Morton
December 13, 2023 at 3:49 pmHey Adam, no worries, it’s not always straightforward. Well not sure what it is but when I changed mine to the wrong filename, I got an error saying it couldn’t find that footage. Your error is different so I’m guessing it might be to do with how your CSV is structured.
Try opening up the CSV file in a notepad, just check each row is on a separate line and that the values are comma separated. How many columns of data do you have by the way? – it’s possible that one of the values somewhere is causing a problem when it’s trying to parse the file.
To help you troubleshoot it, add a blank text layer in your comp. Then on the source text property, Alt + click on the stopwatch and try a few different bits of code here, this might help you work out where the problem is occuring. First try:
value = footage(“afxtest.csv”);
This should show the whole document, it will probably overflow the text box but that just shows it’s working. Then if that works, try:
value = footage(“afxtest.csv”).sourceText.split(“\r”);
Does this work ok? If so, try adding “[0]” before the semicolon at the end to just return the first row. If this causes a problem, you could try “\n” instead of “\r” = they mean similar things but one may work and other may not. Then try:
value = footage(“afxtest.csv”).sourceText.split(“\r”)[0].split(/,/);
Does this work? Again, try adding “[0]” before the last semicolon to return the first value of that row. Possible that there is a comma within a single value (ie, “This, Location” which may cause an issue when parsing.
Give this a go and work out where the problem occurs. You might be able to figure it out yourself from there, but feel free to post back if not. It’s possible to add lots of code to deal with any errors but it may also help to simplify the CSV file – remove any extra columns, remove commas from any text etc.
-
Adam Lewen
December 13, 2023 at 8:34 pmDear Tom, Appreciate your replies very much!
I will look into it more, right now, due to deadline issues I swept into, I ended up using a pretty neat script that actually does what I needed in a simple clean manner.
But since I was trying to figure this out for so long, I am still curious what went wrong with my formatting.
I wanna slowly go over it and manually find it.
Thanks so much for you time! -
Adam Lewen
December 13, 2023 at 8:37 pmThis is the script Locations by Fabian Moron Zirfas.
https://aescripts.com/locations/Your kind of replies is the reason I get help on these forums for so many years. This forum rocks!
-
Tom Morton
December 14, 2023 at 7:09 amNo problem Adam, what goes around comes around so more than happy to help 🙂
Reply to this Discussion! Login or Sign Up