Copy link to clipboard
Copied
Hello, I'm having some issues incorporating variables and data sets into my workflow and was hoping someone would be able to help me out since none of the solutions I've found online have worked.
So all I'm trying to do is import an excel spreadsheet of text lines into photoshop and have photoshop populate a series of text layers from the text in the spreadsheet. So I started off with a smaller sample of the total text, saved it as a as a text (Tab delimited) file and attempted to use this file as a data set. I have a text layer, I've defined the text replacement with the same name as the column above the text ("text" in this case). However when I try to import the text file as my data set I receive the error: "Could not parse the file contents as a data set. There were too many variable names in the first line of the text file."
So I started playing around and troubleshooting and oddly enough when I remove the bottom two lines in the spreadsheet and save it in the same manner the data set now works. This is throwing me off since the error that I keep receiving says that the issue is with the first line of the text file- yet removing the last two lines and keeping the first line the same fixes it. I though that maybe it was because the last two lines didn't have punctuation and the first two do but that came up with the same error. Any help or ideas is greatly appreciated.
Thank you!
1 Correct answer
Check out the .csv version in a text editor to see if empty/garbage lines are at the end, which are not visible once translated into the spreadsheet.
Explore related tutorials & articles
Copy link to clipboard
Copied
Check out the .csv version in a text editor to see if empty/garbage lines are at the end, which are not visible once translated into the spreadsheet.
Copy link to clipboard
Copied
Hey thanks for the reply, I went and deleted all of the columns to the right of the column in use in excel and now it's working- I feel like a bit of an idiot that it was that simple. I imagine you're right though there are probably variables in the columns to the right in the excel spreadsheet that aren't visible on the notepad.
I have another question, (which you're not obligated to answer since you've already helped me with this one!). My whole goal here is to be able to turn these lines of text into png files. So now I have the ability to export several psd files with the appropriate text (which is great, it reduces my workload immensley) but I'm wondering if there's a way to either export as .png (I see that psd is the only option though so Imagine this won't work) or is there an easier way to convert these psd files to png? Again though thanks for your help, you've helped me a lot here!
Copy link to clipboard
Copied
You can bulk convert using an action to save to PNG with the automate/batch command... or use the Image Processor Pro script to batch convert to PNG without needing an action:
https://sourceforge.net/projects/ps-scripts/files/Image%20Processor%20Pro/v3_2%20betas/
Copy link to clipboard
Copied
I do have a script to save datasets directly to JPEG without creating PSD, it could be modified to create PNG.
Copy link to clipboard
Copied
Hey, yeah I just found a tutorial for making an action to save as png and then the batch command! Thanks!
Copy link to clipboard
Copied
I had that issue "There were too many variable names in the first line of the text file." and in my case was because I had an extra column that I was not actually using as a variable, so, I think all columns need to be in variable use before importing the data set.
Copy link to clipboard
Copied
"Could not parse the file contents as a data set. There were too many variable names in the first line of the text file."
Easy way to check for extra space is to open exported file, place cursor at the end of line with variables (or data sets) and use right arrow key on keyboard. If cursor continues or move in the same line then you have space after variable name in the first (or any other) column. If cursor moves after pressing right arrow key to the beginning of next line then you are good to go. This is common problem when creating data sets manually or using Excel spreadsheets.
Copy link to clipboard
Copied
- I had that issue "There were too many variable names in the first line of the text file." No matter which method is used, this problem does not go away. Is there any suitable solution?
 
Copy link to clipboard
Copied
Data sets does not forgive. Ensure no space after each line especially first line with variable names. Also check that you have matching number of variables in file.
