Menu

csv_tools

allan cornet

csv_tools module

atomsRepositoryAdd('http://myscitools.sourceforge.net/5.4')
atomsInstall('csv_tools')

Description:
The purpose of this module is to read and write Comma Separated Values (CSV) data files.
The goal of this module is to improve the flexibility, consistency and speed of
CSV reading and writing with respect to Scilab built-in
write_csv and read_csv functions.

On some large data files, we observed a 100x improvement of the speed.

Features


  • csv_default : Get or set defaults for csv files.
  • csv_getToolboxPath : Returns the path to the current module.
  • csv_read : Read comma-separated value file
  • csv_stringtodouble : Convert a matrix of strings to a matrix of doubles.
  • csv_textscan : Read comma-separated value in a matrix of strings
  • csv_write : Write comma-separated value file
  • csv_isnum: Check if a string represents a number

To compare speed:

with optimized functions:
stacksize('max');
M = ones(1000, 1000);
tic();
csv_write(M, TMPDIR + "/csv_write_1.csv");
toc()

tic();
r = csv_read(TMPDIR + "/csv_write_1.csv")
toc()

with default scilab functions (be patient):
stacksize('max');
M = ones(1000, 1000);
tic();
write_csv(M, TMPDIR + "/csv_write_1.csv");
toc()

tic();
r = read_csv(TMPDIR + "/csv_write_1.csv")
toc()

csv_tools (0.9) -
* move code to cpp (easier to extend features and linux compatibility)
* repository moved on sourceforge (http://hg.code.sf.net/p/myscitools/code/file/tip)
* License update to GPL v3 (please contact author for more information)
* module renamed csv_tools - fork of my previous module (previous version no more supported)
* Updated to compatibility with Scilab-5.4 beta-2
* module build no more require local build to build
* Faster conversion as double
(Tested on 5.4-master Windows 64 bits C2Q 2400 Mhz)
Previous version: Reading with csv_read and conversion to double:
Time = 17.76 (s)
Current version: Reading with csv_read and conversion to double:
Time = 7.34 (s)
* File encoding supported 'utf-8' and 'iso-latin' support by csv_write
* add 'encoding' field in 'csv_default'
* add 'blank' field in 'csv_default'
* Fixed ticket #472: allows to remove all blank lines before parsing
see: csv_default('blank', 'on')
* Updated to use api_scilab (version 3)
* Issue 768: fix some warnings 64 bit and Scilab 5.4 beta-1
* Issue 757: Add a demo of a block-by-block reading in csv_read help file.
* Issue 745: csv_textscan did no convert "1,1" into double.
* Issue 715: csv_textscan crashed on an example.
* Issue 654: csv_default returns %f when used twice

Download
Source


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.