csvreader

A robust comma separated value (CSV) parsing function for MATLAB
705 download
Aggiornato 10 ago 2016

Visualizza la licenza

Overview:
------------
csvreader is a robust comma separated value (CSV) function for MATLAB. The built-in CSV reading in MATLAB is either for numeric data only (csvread) or does not handle complex strings (dataset). There is no built-in MATLAB function that handles reading CSV files that contain quoted strings that may contain commas. For example, the following CSV will be problematic for MATLAB to read in correctly:
Joe Demo,"2 Demo Street, Demoville, Australia. 2615",joe@someaddress.com
Jim Sample,"3 Sample Street, Sampleville, Australia. 2615",jim@sample.com
Jack Example,"1 Example Street, Exampleville, Australia. 2615",jack@example.com

The second entry of each line is an address that contains a comma. Non-robust CSV parsers will fail to put the entire address in the same cell. Further, csvreader will accept quoted strings that contain line breaks.

For help and example usage, type "help csvreader" from the MATLAB command window.

Installation:
------------

The csvreader function uses a Java Archive (JAR) library from the opencsv project. In order to be called from within MATLAB, the opencsv JAR must be placed on MATLAB's Java class path. For more information on the MATLAB java class path see http://www.mathworks.com/help/matlab/matlab_external/bringing-java-classes-and-methods-into-matlab-workspace.html

To install the JAR follow the following steps:

1. Open MATLAB and change the working directory to the same folder as the opencsv 2.3.jar and installCSVReader.m
2. Run the install script by typing 'installCSVReader' in the MATLAB command window

Developers:
------------
If you would like to contribute to the development of this function, you can fork this project from my BitBucket repository: https://bitbucket.org/kkusano/csvreader

Cita come

Kristofer Kusano (2025). csvreader (https://it.mathworks.com/matlabcentral/fileexchange/43551-csvreader), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2012a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.1.0.0

.
.
fixed a bug in the install file that was incorrectly thinking the JAR was already installed.

1.0.0.0