Loading

Salesforce Data Export Rename Downloaded Documents on a Mac

Publiceringsdatum: Jul 2, 2026
Beskrivning

What This Article Covers

When Salesforce users perform a Data Export, the downloaded ZIP file contains a Documents folder. The files in this folder are named using their Salesforce Record IDs (for example, 015300000046RlaEAE) instead of their original document names.

This article explains how Mac users can use the Terminal application and a shell script (.sh file) to batch rename exported files back to their original names using information from the Documents.csv file included in the export.

Note: For Windows instructions, refer to the article Rename exported attachments or document files.

Lösning

How to Rename Salesforce Exported Document Files on a Mac

  1. Open Documents.csv in Microsoft Excel.

  2. Delete all columns except ID and Name.

    • The ID column should be in column A.

    • The Name column should be in column B.

  3. In cell C2, enter the following formula:

="mv "&A2&" """&B2&""""

Understanding the Formula

The formula creates a Mac Terminal rename command for each file. For example, if a file has the Salesforce ID 015300000046RlaEAE and the original filename Technical Specifications V1_2.docx, the formula generates:

mv 015300000046RlaEAE "Technical Specifications V1_2.docx"

This Terminal command renames the exported file from its Salesforce ID to its original document name.

  1. Double-click the lower-right corner of cell C2 to copy the formula down for all rows.

  2. Copy all values from column C.

  3. Open TextEdit on your Mac and paste the copied content.

  4. Convert the file to plain text by pressing Command + Shift + T.

  5. Save the file as rename.sh in the exported Documents folder.

Run the Shell Script

  1. Open Terminal.

    • You can launch Terminal using Spotlight Search by clicking the magnifying glass icon and searching for Terminal.

  2. Navigate to the exported Documents folder by typing:

cd

followed by a space, then drag the Documents folder into the Terminal window and press Enter.

  1. Grant execution permissions to the script:

sudo chmod 777 rename.sh

Enter your Mac password when prompted.

  1. Run the script:

sudo ./rename.sh
  1. The script will process each command and rename the files in the Documents folder to their original names.

  2. After confirming the files have been renamed successfully, close Documents.csv without saving any changes.

 

 

Ytterligare resurser

VIDEO: Salesforce Support video demonstrating how to rename exported document files on a Mac using Excel, TextEdit, and Terminal. The video covers opening Documents.csv, generating rename commands, creating the shell script, running the script in Terminal, and verifying that the files have been renamed successfully.

Knowledge-artikelnummer

000381782

 
Laddar
Salesforce Help | Article