CSV Data for SPA 9

Video Tutorials

Video tutorials are located at the bottom of the page – CLICK HERE.

What CSV (or TSV) data is used for

Sports Photo Automation can use CSV or TSV data to customize the compositions on a per image basis. Data functions include the following.

  • auto replace text
  • auto scale text
  • specify a background (overrides the default choice)
  • specify addition images such as a team image for memory mate, additional player images, logo image, ect
  • specify the output file name (overrides the default naming)
  • run photoshop actions on the composition

Changes for SPA 8/9 (compared to SPA 7)

  • You MUST enter SPA into cell A1. This was needed because some spreadsheet programs put hidden content above row 1 that you won’t see in the spreadsheet but it will show up in a plain text editor and will be seen by spa.  Having SPA in cell A1 tells SPA where the data begins. SPA 8 will not load the CSV file unless cell A1 has SPA entered into it.
  • All image file names in the csv MUST contain the file extensions. The only exception the NEW FILE NAME column. For that, it will get the extension from the save file format selected in the batch settings.  You can have the extension in the new file name column and it won’t hurt anything, but it isn’t required.
  • The CSV header themselves are NOT case or space sensitive. However, the PSD text layers themselves are. The PSD text layers must be ALL CAPS, NO SPACES.  Also, the PSD text layers must use the designated SPA layer names if you want to use the CSV to replace text.

Sample CSV

This is a basic sample CSV. This is showing text replacement for 4 layers without text resizing.

Column A – Cell A1 must contain the word SPA. This is how the program knows where the data will start.

All entries in columns A below SPA will be the image file names from the player images source folder. The image names must match your file names exactly. The entries must have the file extension.  For example, if your file name is DSC_2345.png then don’t just put DSC_2345 in the cell. It must be entered as DCS_2345.png.

Other Columns – The other columns are for any custom processing commands that need done. This can be text replacement, photoshop action, custom file renaming, ect. There are no particular order for the other columns other than column A. Also, all columns are optional. Only use the columns you need based on the tasks you are giving it to do from the CSV file.

Text Replacement

To use the CSV text replacement, you need to add the column header to match the layer name in the CSV.  In the cell data, enter the text you want to replace. The layer name in the PSD template MUST be one of the designated SPA text layer names. Also, the layer name in the PSD template must be ALL CAPS, NO SPACES. You can’t just choose any layer names you want for the text layers if you want to use CSV text replacement.

This is the list of valid SPA text layer names.

  • NAME
  • YEAR

Auto text rescaling

Auto text scaling is optional. If you don’t add this column or leave the cells blank then you can still replace text but not resize it. One example of when you may not wan to use resizing would be jersey numbers if they are either 1 or 2 digits. You way not want the 1 digit numbers stretching to match the template layout that has a 2 digit number.

How to auto resize the text in batch…..

Add a header starting with “resize-” followed by the Layer Name that will be auto scaled. In the data section, add the scaling method of X, Y or A. The scaling methods are as follows.

X – Scales horizontal

Y – Scales vertical

A – Scales angled – Note: This will not add an angle to you text. Use this is you text is already at an angle. Sports Photo Automation will automatically determine the angle of the text so it can scale appropriately.

XM – Scales the same as X except will only scale if the new text is longer than the text in the template. Shorter text is not scaled.

YM – Scales the same as Y except will only scale if the new text is longer than the text in the template. Shorter text is not scaled.

AM – Scales the same as A except will only scale if the new text is longer than the text in the template. Shorter text is not scaled.

Team images, additional player images, and logo images

You can add additional player images, team images and logo images through the csv file. 

For additional payer images, the image must be in the same folder as the player 1 images. You can add up to 3 players.

For the team and logo images, you must select the option in the batch settings to use the csv for teams and or logos. The you need to select the folder that contains the teams and/or logo images.  It is best to not use the players folder to store the teams and logos.  However, if you do then it will still work as long you you run using the CSV file. However, it you run a batch WITHOUT the CSV file and you have team images and logo images mixed in the player folder then it will try to use all of the images as player images.

Additional CSV Options

Additional CSV Header Codes-

Note: The cell data is case sensitive. The headers ARE NOT case sensitive.

NEW FILE NAME – This will use a custom file name to use when saving the final image. If the cell is empty then it defaults to the naming that was selected in the Sports Photo Automation Lab user interface.

APPEND FILE NAME – This will add a text string to the end of the file name. This may also be used in combination with the NEW FILE NAME header.

SUB FOLDER – This will save the composite to a subfolder of the save folder.

Note: DON’T put the entire path in. Only put the name of the subfolder (or path) that is after the save folder. 

For example, if the save folder is named Broncos and you want a folder named Memory Mates, then only Enter Memory Mates in the cell.  The it will save to a folder called Memory Mates under the Broncos Folder.  If you want nested subfolder then you can also enter those in the cell with either or / separating the folders. So for example, if the save folder was Broncos and you entered Individuals/8X10 in the cell, it would save to Broncos/Individuals/8X10.

You don’t need to create the subfolders first. If the subfolders don’t exist, then SPA will create the folders automatically.

TEAM FILE – This is used to define the team file for a memory mate template. It will reference the team folder selected in the batch settings window. The names must contain the file extension.

LOGO FILE – This is used to define the logo file for the template. It will reference the logo folder selected in the batch settings window. The names must contain the file extension.

PLAYER 2 FILE or PLAYER FILE 2  – Both header names do the same thing. There are just 2 different header name options (in order to keep CSV compatibility for SPA 7 an 8).

This will add a second image. The image can be another image of the player, a logo image, or any other image that you want to add on a per player basis. The image file must also be in the same source folder that the batch is being ran in.

PLAYER 3 FILE or PLAYER FILE 3 – Works the same as Player 2 File.

BG FILE, BACKGROUND FILE, or TEMPLATE FILE –  All 3 header names do the same thing. There are just 3 different header name options (in order to keep CSV compatibility for SPA 7 and 8).

This will use the background or PSD template in the cell. It will reference the backgrounds folder selected in the batch settings window. If the cell is blank then it will use the default background file selected in the batch settings window.

PRE ACTION 1 (and 2,3 etc.) – Use this to run a Photoshop action on the file before it is extracted. You can run up to 3 actions. They run in sequential order. The column names will be Pre Action 1, Pre Action, 2, or Pre Action 3. In the cell data put the name of the Action Set and the Action separated by the “|” character (the one on thekey above the enter key).

POST ACTION 1 (and 2,3 etc.) – This is set up the exact same way as the pre actions except the header read as Post Action 1, Post Action 2, etc. up to 5. The actions run after the template has been completed but before it is flattened and saved.



CSV Getting Started

This video covers the basics for starting to use CSV files with SPA.

Auto CSV Starter

You can use the auto CSV starter to quickly setup the CSV structure.  This will ensure that the CSV headers and player file names are correct.

TSV Files for data with commas

If your data has commas in it then you need to use a tab delimited .tsv file instead of a .csv file.

CSV (or TSV) data with quotes

When using quotes, the CSV data must be set up with “curly” quotes, not “straight” quotes. Using straight quotes will cause extra hidden quotes to be added to the data file which you will not see in the spreadsheet (but can see in a plain text editor).

Also,  You will need to use a font in your PSD files that works with curly quotes.