posted Apr 5, 2011, 7:47 PM by Ezra Kenigsberg
[
updated Apr 5, 2011, 9:05 PM
]
#DataTipOfTheDay 2011-04-05Q: "How do I restore the filenames of Attachments and Documents downloaded using Data Export?"
A: If you use Data Export to export Attachments and Documents, you've probably noticed that the exported files' names have been changed to their Salesforce IDs (an 18-character code that begins with "00P" for Attachments and "015" for Documents).
To restore the Attachments' original names, do the following: - Open the file "Attachment.csv" in Excel
- Delete all columns but "ID" and "Name". Once all other columns are deleted, "ID" should be in column A and "Name" should be in column B.
- Copy the formula on the following line and paste it into cell C2.
="RENAME "&A2&" """&B2&"""" The resulting cell should look like this: RENAME 00P300000046RlaEAE "Technical Specifications
V1_2.docx"
- Copy cell C2 and paste it all the way down column C, to the last row that has ID and Name values in it.
- Select column C and copy it.
- Open Notepad.
- Paste the copied cells into Notepad.
- Click File|Save in Notepad, and save the file in your exported Attachments directory as "Fix.bat" (without the quotation marks).
- Navigate to your exported Attachments directory and double-click "Fix.bat". It should rename all the Attachments appropriately.
- Close "Attachment.csv" in Excel without saving any changes.
The procedure for restoring the Documents' original names is similar: - Open the file "Document.csv" in Excel
- Delete all columns but "ID", "Name", and "Type". Once all other columns are deleted, "ID" should be in column A, "Name" should be in column B, and "Type" should be in column C.
- Copy the formula on the following line and paste it into cell D2.
="RENAME "&A2&" """&B2&IF(RIGHT(B2,LEN(C2))=C2,"","."&C2)&"""" The resulting cell should look like this: RENAME 01530000000cmjjAAA "Setup Checklist.png"
- Copy cell D2 and paste it all the way down column D, to the last row that has ID, Name, and Type values in it.
- Select column D and copy it.
- Open Notepad.
- Paste the copied cells into Notepad.
- Click File|Save in Notepad, and save the file into your exported Documents directory as "Fix.bat" (without the quotation marks).
- Navigate to your exported Documents directory and double-click "Fix.bat". It should rename all the Documents appropriately.
- Close "Document.csv" in Excel without saving any changes.
|
|