In the mapping file for command line data loader we can map column name to the salesforce field
BillingCountry=BillingCountry
or a constant value to the salesforce field
"United\ States"=BillingCountry
Is there a way we can provide concatenation of both like
"This is Country"&BillingCountry=BillingCountry
I have tried the following but all of them loading blank values to BillingCountry
"This is Country"&BillingCountry=BillingCountry
"This is Country"&&BillingCountry=BillingCountry
"This is Country"+BillingCountry=BillingCountry
Scenario:
We have a developer sandbox which gets refreshed every month. Our support team loads the data exported from Production into this sandbox using data loader. We are requested to automate that.
We stuck at data loading Document records to the sandbox. We extract Document with the following mapping
FolderId=FolderId
Name=Name
DeveloperName=DeveloperName
ContentType=ContentType
Type=Type
IsPublic=IsPublic
Description=Description
NamespacePrefix=NamespacePrefix
Currently we open the extracted csv, add a column named Body with "E:\Projects\AJG\Training Sandbox Refresh\Data Load\Data\Images\"&DeveloperName&"."&Type
provided the path is having the files and load the data into Sandbox.
We want to eliminate the manual work of opening the csv and manipulating it.
Workaround
Created a batch file to manipulate the csv to create a new csv with the Body column populated as per the requirement and then loading the data to sandbox.
@echo off
setlocal enabledelayedexpansion
set inputCSV=%1
set outputCSV=%2
set url=%3
set url=!url:"=!
if exist "%outputCSV%" del "%outputCSV%"
echo "FOLDERID","NAME","DEVELOPERNAME","CONTENTTYPE","TYPE","ISPUBLIC","DESCRIPTION","BODY">%outputCSV%
for /f "skip=1 delims=" %%C in ('type "%inputCSV%"') do (
set Line=%%C
for /f "tokens=3,5 delims=," %%a in ("!Line!") do (
set Col3=%%~a
set Col5=%%~b
set Col3=!Col3:"=!
set Col5=!Col5:"=!
set NewCol=!Col3!.!Col5!
>>"%outputCSV%" echo %%C,"%url%!NewCol!"
)
)