Upload a Spreadsheet as a Data Table

Upload a spreadsheet file to Catalytic to create a new Data Table.

Returns a reference to the created Data Table.

Method Signature

DataTable upload(File fileToUpload, String tableName);
DataTable upload(File fileToUpload, String tableName, Integer headerRow, Integer sheetNumber);

Parameters

ParameterTypeDescription
fileToUploadFileThe File to upload. Must be a CSV, XLS or XLSX file
tableNameStringThe name of the table to create. Defaults to
the uploaded file name.
headerRowIntegerThe index of row containing column headers.
Row counting starts at 1.
sheetNumberIntegerThe index of the worksheet to import for Excel files.
Defaults to 1.
returnsDataTableThe uploaded Data Table

Example

/*
 * This example demonstrates uploading a Data Table to Cataltyic
 */
import org.catalytic.sdk.CatalyticClient;
import java.io.File;

public class Program {
  
    public static void main(String[] args) throws Exception {
      
      	// Create and Initialize Catalytic SDK Client
        CatalyticClient catalytic = new CatalyticClient();
      
      	// Upload spreadsheet as a Data Table
      	File file = new File("/Users/alice/table.csv");
        DataTable dataTable = catalytic.dataTables().upload(file, "My Table");
      
      	System.out.println("Uploaded DataTable has ID " + dataTable.getId());
    }
}