function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VDid.ax1020VDid.ax1020 

Carriage returns in data exports

Hi All,

 

I am running an export of our customer data from salesforce.com which is being uploaded into our Oracle billing system. On the Billing Street field I have carriage returns because our users use multiple lines to input street information. Is there a way to strip out the carriage returns from the address field while creating the extract via dataloader?

 

Thanks for your help.

 

V

sfdcfoxsfdcfox

No, you'll have to massage the data post-export using something like MySQL, Perl, PHP, or some other scripting or database language. The Data Loader moves data verbatim into and out of salesforce.com.

Rahul Jain.ax1619Rahul Jain.ax1619

Hi ,

I am facing same issue. Please let me know if you have any solution.

 

Thanks

Rahul

Rahul Jain.ax1619Rahul Jain.ax1619

Hi,

 

You can call below shell script by passing CSV file name as a parameter.

This Shell script will replace  Carriage returns.

 

 

if [ $# != 1 ]; then
echo "Please pass the filename as argument"
exit 1;
fi


fName=$1
fName1=$fName'_tmp'
fName2=$fName'_tmp2'
finalFName=`echo $fName | awk -F "_" '{print $1}'`'.txt'

# delete all "\r"
tr -d '\r' < $fName > $tempFName1

#Reaplace all \n of the file
perl -l40 -pe '$\="\n" if eof' $tempFName1 | perl -p -e 's/" "/\"\n\"/g' > $tempFName2

 

Call This

 

"sh Reach.sh <CSVFilePath/Name>"