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
TheRotnelsonTheRotnelson 

How can I define which delimiter the data loader should use when run by command line?

Does someone know how define which delimiter the data loader should use when it is executed by command line? I am using version 38. The GUI has an option for defining allowed CSVs delimitters, but I cannot find that there is a parameter for this using the datalaoder trough command line.
The source files I am loading are delimited by tab and has values containing commas. This makes the dataloader fails since it interprets both as column separation.
TheRotnelsonTheRotnelson
This is the version I am using Alain, and as I wrote in my post this is doable trough the GUI as you point out but not when you run the command line interface..
Alain CabonAlain Cabon
Hi,

You can read the source code here:

https://github.com/forcedotcom/dataloader/blob/master/src/main/java/com/salesforce/dataloader/dao/csv/CSVFileReader.java
 
if (config.getBoolean(Config.CSV_DELIMETER_OTHER)) {
                separator.append(config.getString(Config.CSV_DELIMETER_OTHER_VALUE));
            }

https://github.com/forcedotcom/dataloader/blob/master/src/main/java/com/salesforce/dataloader/config/Config.java
 
// 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";

Regards

Alain

 
Alain CabonAlain Cabon
You have the correct version but you need to read the java source code and you can try loader.csvOtherValue as a parameter in the settings for the command line. That could work. I am a java developer so I can help you and I will also try.
Alain CabonAlain Cabon
"Secret" parameters or not accessible from the command line? 

https://developer.salesforce.com/docs/atlas.en-us.dataLoader.meta/dataLoader/loader_params.htm

loader.csvOtherValue is not published yet or needs a patch.
TheRotnelsonTheRotnelson
Thanks Alain! This was useful.
I´ll try to run with loader.csvComma=false in config.properties
TheRotnelsonTheRotnelson
Setting the properties
loader.csvComma=false
loader.csvTab=true
did not help.
Looks like these values are set with a value hard coded in the source code.
 
Alain CabonAlain Cabon
Hi,

The problem should be here : custDelimiter is always false by this way.

public CSVFileReader(String filePath, Controller controller) {
        this(new File(filePath), controller.getConfig(), false);
 }

http:// https://github.com/forcedotcom/dataloader/blob/master/src/main/java/com/salesforce/dataloader/dao/csv/CSVFileReader.java (http:// https://github.com/forcedotcom/dataloader/blob/master/src/main/java/com/salesforce/dataloader/dao/csv/CSVFileReader.java)
 
TheRotnelsonTheRotnelson
Alain CabonAlain Cabon
It is just perhaps because the published documentation of the parameters is not up-to-date yet because otherwise there is no reason for having "false" instead of "true" for the custDelimiter. The next release of the dataloader should be "complete".