org.excel4j.addin
Class CSVAddin

java.lang.Object
  extended by org.excel4j.reflect.ReflectAddin
      extended by org.excel4j.addin.CSVAddin
All Implemented Interfaces:
Addin

public class CSVAddin
extends ReflectAddin

Utility functions for handling CSVs.


Nested Class Summary
static class CSVAddin.Table
          Contains a CSV.
 
Field Summary
 
Fields inherited from class org.excel4j.reflect.ReflectAddin
argMapper, attributes, pne
 
Constructor Summary
CSVAddin()
           
 
Method Summary
 java.lang.String[][] GetData(CSVAddin.Table table)
          Grabs all the data for the CSV.
 java.lang.String[] GetHeaderRow(CSVAddin.Table table)
          Grabs just the header row.
 int GetNumColumns(CSVAddin.Table table)
          Gets the number of columns (uses the first row).
 int GetNumRows(CSVAddin.Table table)
          Gets the number of rows for the CSV (including the header/first row).
 java.lang.String[][] Read(java.lang.String url)
          Read a CSV from a file or URL.
 CSVAddin.Table ReadAsObject(java.lang.String url)
          Read in a CSV file/url and return as an object (so it can be manipulated).
 java.lang.String[][] ReadEx(java.lang.String url, java.lang.String delim, java.lang.Boolean hasQuotes)
          Read a CSV from a file or URL.
 
Methods inherited from class org.excel4j.reflect.ReflectAddin
close, getAddinCategory, getAttributes, getAttributes, getFunctions, getLongName, getName, open
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVAddin

public CSVAddin()
Method Detail

Read

public java.lang.String[][] Read(java.lang.String url)
                          throws java.lang.Exception
Read a CSV from a file or URL.

Parameters:
url. -
Returns:
String[][] (as the csv array).
Throws:
java.lang.Exception

ReadAsObject

public CSVAddin.Table ReadAsObject(java.lang.String url)
                            throws java.lang.Exception
Read in a CSV file/url and return as an object (so it can be manipulated).

Parameters:
url. -
Returns:
Table.
Throws:
java.lang.Exception

GetHeaderRow

public java.lang.String[] GetHeaderRow(CSVAddin.Table table)
Grabs just the header row.

Parameters:
table. -
Returns:
String[].

GetData

public java.lang.String[][] GetData(CSVAddin.Table table)
Grabs all the data for the CSV.

Parameters:
table. -
Returns:
String[][].

GetNumRows

public int GetNumRows(CSVAddin.Table table)
Gets the number of rows for the CSV (including the header/first row).

Parameters:
table. -
Returns:
int.

GetNumColumns

public int GetNumColumns(CSVAddin.Table table)
Gets the number of columns (uses the first row).

Parameters:
table. -
Returns:
int.

ReadEx

public java.lang.String[][] ReadEx(java.lang.String url,
                                   java.lang.String delim,
                                   java.lang.Boolean hasQuotes)
                            throws java.lang.Exception
Read a CSV from a file or URL.

Parameters:
url. -
Returns:
String[][] (as the csv array).
Throws:
java.lang.Exception