2

As you're all aware, salesforce is disabling all old data loader versions in order to prepare for the new TLS requirements.

I've had a feed in place for a couple years where our application spits out a file on a drive and I have the command line interface pick up the file via a windows task scheduler to load it into the database. The requirements for the file was that it needed to be comma delimited.

This was working great with version 32 of the data loader.

It seems somewhere between version 32 and version 37 that tabs are now recognized as delimiters in the data loader - which causes a problem for the feed as some of our data in our application has it. There's no way to prevent it either if we did a mass clean up in our application.

Ideally I would be able to update the .xml file to specify that it should delimit by commas only. I don't see a parameter in their documentation (http://resources.docs.salesforce.com/202/10/en-us/sfdc/pdf/salesforce_data_loader.pdf - data loader process configuration parameters).

Am I overlooking something? Does anyone have any suggestions on how to overcome this without submitting a ridiculous ticket to prevent tabs to our application developers?

2 Answers 2

2

I know this almost a 2 years old thread but I want to improve the solution to above.

First of all, thanks to kkorynta as his/her solution help me to fix my issue.

My problem was that even I have enabled in my process-conf.xml

<entry key="loader.csvOther" value="true"/> 
<entry key="loader.csvOtherValue" value="|"/>

The command line process was failing due some commas in the text. I know the RFC standard says you can enclose the csv with double quotes and it will work. However, in my case the source system was not able to send the CSV like that.

So I dig a little bit more the class provided above

\src\main\java\com\salesforce\dataloader\dao\csv\CSVFileReader.java

And found that additional we have CSV_DELIMETER_COMMA which was causing the issue to me.

if (config.getBoolean(Config.CSV_DELIMETER_COMMA)) {
     separator.append(",");
 }
if (config.getBoolean(Config.CSV_DELIMETER_TAB)) {
     separator.append("\t");
}

Then I thought, this is a boolen, it should be in the configuration somewhere else and found that those are defined in the line 131 of the file

https://github.com/forcedotcom/dataloader/blob/master/src/main/java/com/salesforce/dataloader/config/Config.java

Settings,

/ Delimiter settings
public static final String CSV_DELIMETER_COMMA = "loader.csvComma";
public static final String CSV_DELIMETER_TAB = "loader.csvTab";
public static final String CSV_DELIMETER_OTHER = "loader.csvOther";
public static final String CSV_DELIMETER_OTHER_VALUE = "loader.csvOtherValue";

Which means you can use loader.csvComma or loader.csvTab in the process-conf.xml or in the config.properties file to set it globally.

I have added below lines in the config.properties and it worked like a charm

loader.csvComma=false
loader.csvTab=false

So, with this solution you don't need to re-compile the DataLoader.

0

I contacted salesforce support and essentially there is a git project out there where you can build your own custom data loader.

Here is the location of the git project: https://github.com/forcedotcom/dataloader

You'll want to pull down the project and then modify the CSVFileReader.java file. The directory should look something like this:

\src\main\java\com\salesforce\dataloader\dao\csv\CSVFileReader.java

The last I looked at this file (8/26/2016), all that needed to be done was to comment out lines 85 through 90 to turn off any additional delimiters.

/*if (config.getBoolean(Config.CSV_DELIMETER_TAB)) {
separator.append("\t");
}
if (config.getBoolean(Config.CSV_DELIMETER_OTHER)) {
separator.append(config.getString(Config.CSV_DELIMETER_OTHER_VALUE));
}*/

Previous builds had to be modified by changing this

csvReader = new CSVReader(input, "UTF-8", new char[]{',', '\t'});

to this

csvReader = new CSVReader(input, "UTF-8", new char[]{','});

on lines 256 and 258.

Once you've modified the CSVFileReader.java file, you will then compile the project. The resulting .exe file is your modified DataLoader.

I believe they have made the ability to toggle additional delimiters in the interface, but until it's available for the bean process of the CLI this was the only work I found.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .