Help

Solution: An easyish and free way to download (and rename) all your images from an Airtable table

Topic Labels: export images rename
4257 4
cancel
Showing results for 
Search instead for 
Did you mean: 
KoenS
5 - Automation Enthusiast
5 - Automation Enthusiast

A question that gets asked often is how to bulk download your images from an Airtable table. There are paid solutions that work (eg via MiniExtensions) but there does not seem to be a good solution that is free and easyish.

I found one that works for me.

To download the pictures there are 4 basic steps and an optional fifth step to bulk rename those pictures:

step 1: download the table as .csv
step 2: get the URLs of each image
step 3: create a text file where you paste all the URL's
step 4: use e.g. Internet Download Manager to download via those URL's all the images into a folder
(optional) step 5: bulk rename those images

What you need: a text editor (e.g. SublimeText), a download manager (e.g. Internet Download Manager) and, optionally, a bulk renamer (e.g. Flash Renamer)

step 1
When you download a table as a .csv file and then open that .csv file, the column with the images will instead of an image have the name of the image file + its URL.

downloadcsv.png

So every cell in the csv that in Airtable would have contained an image will contain something like this:

Lassie.png (https://v5.airtableusercontent.com/v1/11/11/1669234400000/zseYdWtAXPktp-aHBrLIow/RYfTyZfygSYyJys2tZ9...)

What you need to be able to download the original images is those URLs.

Step 2
Select the entire column for which you want the images and copy it. Open a text editor (e.g. SublimeText) and paste what you just copied into the new .txt document. On each line you should now have the name of the image and between brackets its URL. Every line in the .txt file corresponds to a row in the .csv file. For the cells in the .csv file's column that didn't contain images the line in the .txt file will be blank.

Step 3
Now to get rid of the original image file name and the brackets and only have the URLs remaining you need to use Find and Replace using Regular Expressions syntax.
In the .txt document go to Find and Replace (ctrl+H). Be sure to turn on 'Regular Expressions' (the A circle in the picture below)

sublime.png
Then in Find you type:

.+ \( (period, plus sign, space, backslash, opening bracket)

And in Replace you type nothing at all.
Then click 'Replace All'.
Still in the Find and Replace menu in Find you type:

\)\n (backslash, closing bracket, backslash, the letter n)

And in Replace you type:

\n

Then click 'Replace All'.

Now you have a list with just the URLs.
Save this document as a .txt file, e.g. 'urls.txt'

Step 4
Download and install a Download Manager, e.g. Internet Download Manager (IDM).
Open IDM, go to Tasks, then Import, and then find and select the .txt file you just created.
In the window that opens, click on 'Check All' in the new window, select or create a folder you want to save the images to at the bottom left of the window ("All files in one directory") and click OK.

IDM.pngAll your images are now saved in that folder.


---


Step 5 (optional)
The only downside is that this leaves you with random names for your images. But you can change this quite easily by creating a mapping document and using a Bulk Renamer app.

The names that the download manager gave to the images are the part of the URL that comes after the last /.
So for example, if the images you just downloaded are .png files then the file name of the image whose URL is

https://v5.airtableusercontent.com/v1/11/11/1669234400000/zseYdWtAXPktp-aHBrLIow/RYfTyZfygSYyJys2tZ9...

becomes

9XeWZBL8m4Fq3lC3l7X9_snQcdZ6-GrHxHQn3QigFgI.png

Suppose your images are from a Airtable table that has records of the dogs your dogwalking service takes for walks. The first column in the table has the names of each dog. The second column has their picture. Now you want your downloaded dog pictures to be named after the dogs they are a picture of. What you need is a way of mapping those dog names onto the current random names.

This is easy to do because as we just saw the random names of the dog pictures are derived from the URLs of those pictures. And in the .csv file you downloaded from Airtable, in the column where the pictures should be you instead see in the same row 1) the name of the dog, 2) the name of the original image and between brackets the URL of the picture of the dog. We now just need to add a third column with the random name of the images we just downloaded, and we can derive those random names for each dog from the URL. So create that third column in the .csv file for the random names of the images.

Then in the text editor in the .txt file with the URLs, go to Find and Replace. In Find type:

.+\/ (period, plus sign, backslash, forward slash)

In Replace type nothing at all.
Click on Replace All.
Still in Find and Replace, in Find type:

\) (backslash, closing bracket)

In Replace type nothing at all.
Then click on 'Replace All'.
Still in Find and Replace, in Find type:

/\ (forward slash, backslash)

In Replace type nothing at all.
Then click on 'Replace All'.

Now you have a list with all the random names for the downloaded images, in the same order as the corresponding list of URLs for the original images. Select All and copy that list of random names, and paste it into the newly created column in the .csv file.
You should now for each dog have three columns with 1) the name of the dog, 2) the name of the original picture and between brackets the URL of the picture, 3) the random name of the downloaded picture of that dog.

What you want to do now is bulk rename all your downloaded pictures, from the random names to the names of the dogs that are depicted in the image.

Create a new .csv file in Excel, Google Sheet or whatever spreadsheet app. On the first line of that new sheet, in the first column type 'old' and in the second column 'new'. On the second line in the first column paste the list of random names that you copied a moment ago (the third column in your original .csv), and in the second column paste the corresponding list of names of the dogs (the first column in your original .csv). Save this new .csv file as 'rename.csv'.

Then download a Bulk Renamer app. I used Flash Renamer.

Go to Advanced tab, then CSV list tab, and select the 'rename.csv' file you just created. At the top of the screen navigate to the folder where you saved your images. Then click Rename at the bottom left of the screen. All your dog pictures will now be renamed using the name of each dog.

renamer.png

4 Replies 4
Matthew_Lanni
7 - App Architect
7 - App Architect

Wow! This is a great free solution. Thank you for the in-depth instructions too 🙌

Thanks for posting such a detailed explanation!

A few notes:

  • Make sure that you download the files within a couple of hours of creating the CSV file. The urls will expire after a couple of hours. (If you have opted-out of expiring attachment urls until February 2022, you may have more time.)
  • This process works if you have only one attachment per record. If you have multiple attachments per record, this method of using regular expressions to isolate only the urls without the filenames won't work.
  • There is also a slight risk of issues with the regular expression if you have parenthesis in any filename.
KoenS
5 - Automation Enthusiast
5 - Automation Enthusiast

In step 3, to avoid the potential issue Kuvonne pointed out instead of

Then in Find you type:

.+ \( (period, plus sign, space, backslash, opening bracket)

And in Replace you type nothing at all.
Then click 'Replace All'.

do this:

Then in Find you type:

.+ \(http (period, plus sign, space, backslash, opening bracket, the letters http)

And in Replace you type

http

Then click 'Replace All'.

stardust_ad
4 - Data Explorer
4 - Data Explorer

Thank you so much!