Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : csv_readwrite details
Login with GitLab

csv_readwrite

Fast functions to read and write csv files
(3466 downloads for this version - 31197 downloads for all versions)
Details
Version
0.6
A more recent valid version with binaries for Scilab 5.4 exists: 0.6.1
Authors
Allan CORNET
Michael Baudin
Owner Organization
Scilab - DIGITEO
Maintainer
Michael BAUDIN
Category
License
Creation Date
February 1, 2012
Source created on
Scilab 5.4.x
Binaries available on
Scilab 5.4.x:
Linux 32-bit Windows 32-bit Windows 64-bit macOS Linux 64-bit
Install command
--> atomsInstall("csv_readwrite")
Description
            Purpose
-------

The purpose of this module is to read and write 
Comma Separated Values (CSV) data files. 
The goal of this toolbox 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: tests 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_readwrite (0.6) - February 2012
    * This version requires Scilab 5.4.0
    * Factorized code with new code in Scilab.
    * Uses assert functions for tests.
    * Add also %pi, %inf, %nan as format for pi, inf and nan number.
    * Update demos with some benchs.
    * Add csv_isnum function x10 (or more) faster than isnum scilab function
    * Fixed ticket #637: module did not start in -NWNI mode
    * Fixed ticket #644: csv_read did not support empty fields
            
Files (6)
[543.69 kB]
Source code archive

[479.58 kB]
Linux 32-bit binary for Scilab 5.4.x
Linux 32-bit
Automatically generated by the ATOMS compilation chain

[217.22 kB]
Windows 32-bit binary for Scilab 5.4.x
Windows 32-bit
Automatically generated by the ATOMS compilation chain

[226.43 kB]
Windows 64-bit binary for Scilab 5.4.x
Windows 64-bit
Automatically generated by the ATOMS compilation chain
[472.55 kB]
macOS binary for Scilab 5.4.x
MacOSX version
Automatically generated by the ATOMS compilation chain

[482.64 kB]
Linux 64-bit binary for Scilab 5.4.x
Linux 64-bit
Automatically generated by the ATOMS compilation chain

News (0)
Comments (5)     Leave a comment 
Comment from Allan CORNET -- February 1, 2012, 02:29:16 PM    
See Benchmarks in Demos 

(Test on Windows 64 bit - scilab 5.4.0 alpha1 - C2Q 2400 Mhz)

benchmark csv read/write:

Writing with write_csv...
Time = 62.40 (s)
Reading with read_csv...
Time = 29.37 (s)
Writing with csv_write...
Time = 2.14 (s)
Reading with csv_read...
Time = 15.67 (s)
Reading with read_csv and conversion to double...
Time = 134.11 (s)
Reading with csv_read and conversion to double...
Time = 17.76 (s)

csv_write is x29 faster than write_csv.
csv_read is x1.87 faster than read_csv.
csv_read (with conversion to double) is x7 faster than read_csv.



benchmark csv_isnum:

Bench with isnum (Please waiting) ...
Time = 188.39 (s)
Bench with csv_isnum ...
Time = 0.26 (s)

csv_isnum is x730 faster than isnum.


Allan
Comment from adrien vogt-schilb -- May 14, 2012, 11:07:21 AM    
Hi,

I am interested in: Fixed ticket #644: csv_read did not support empty fields

But when I atomsInstall('csv_readwrite')  from scilab 5.4alpha1, csv_read still fails to
read empty fields. 
What is wrong?

Comment from hehi ha -- June 11, 2012, 06:38:55 AM    
Hi.
I want to build this module and add to xcos (external module). But have error
  error("it requires a local built of Scilab");
                                               !--error 10000 
What's wrong?
Answer from Michael BAUDIN -- June 20, 2012, 09:04:46 AM    
Hi,

Please read :

http://forge.scilab.org/index.php/p/csv-readwrite/issues/240/

Best regards,

Michaël

> Hi.
> I want to build this module and add to xcos (external module). But have error
>   error("it requires a local built of Scilab");
>                                                !--error 10000 
> What's wrong?
Comment from Oscar van der Velde -- June 26, 2012, 03:02:17 PM    
The new Scilab 5.4.0 beta 1 64-bits (22 June) cannot load this module yet:

---
Start CSV read write
	Load macros
	Load gateways
atomsLoad: An error occurred while loading 'csv_readwrite-0.6-0':
	link: The shared archive was not loaded: A dynamic link library (DLL) initialization
routine failed.
---
Answer from Oscar van der Velde -- July 9, 2012, 07:30:23 PM    
Could you update or fix this issue? I'm curious to test the 5.4 beta. Or is it a problem
with the 5.4 beta which needs to be resolved first? 

best regards,
Oscar

> The new Scilab 5.4.0 beta 1 64-bits (22 June) cannot load this module yet:
> ---
> Start CSV read write
> 	Load macros
> 	Load gateways
> atomsLoad: An error occurred while loading 'csv_readwrite-0.6-0':
> 	link: The shared archive was not loaded: A dynamic link library (DLL) initialization
> routine failed.
Comment from Casey Davis -- August 6, 2012, 10:56:56 PM    
First, thank you for creating and maintaining this module.  It is very useful because of
its efficiency - I use it daily.  

Second, I can get this working on 5.4.0-alpha (XP, 32bit), but not on either of the
5.4.0-beta versions.  Please see below.

Any help would be greatly appreciated.  


        ___________________________________________        
                    scilab-5.4.0-alpha-1

                Consortium Scilab (DIGITEO)
              Copyright (c) 1989-2011 (INRIA)
              Copyright (c) 1989-2007 (ENPC)
        ___________________________________________        
 
 
Startup execution:
  loading initial environment

Start CSV read write
	Load macros
	Load gateways
	Load help
	Load demos
	Type "demo_gui()" and search for "CSV read write" for Demonstrations.






      ___________________________________________        
     
               scilab-5.4.0-beta-2

                    Scilab Enterprises
                Consortium Scilab (DIGITEO)
       Copyright (c) 2011-2012 (Scilab Enterprises)
              Copyright (c) 1989-2012 (INRIA)
              Copyright (c) 1989-2007 (ENPC)
        ___________________________________________        
 
 
Startup execution:
  loading initial environment

Start CSV read write
	Load macros
	Load gateways
atomsLoad: An error occurred while loading 'csv_readwrite-0.6-0':
	link: The shared archive was not loaded: A dynamic link library (DLL) initialization
routine failed.






Answer from Simon GARESTE -- August 8, 2012, 04:15:18 PM    
Hi,

This issue is fixed now, in 0.6.1 version. It was due partly to the disparition in 5.4 
beta of a specific Scilab library. In a general way, modules that contains gateways and 
haven't been recompiled since the beta release must be recompiled. We are doing this, but 
have other emergencies at the same time, so we treat modules one by one when users 
encounter troubles.
> First, thank you for creating and maintaining this module.  It is very useful because
> of
> its efficiency - I use it daily.  
> 
> Second, I can get this working on 5.4.0-alpha (XP, 32bit), but not on either of the
> 5.4.0-beta versions.  Please see below.
> 
> Any help would be greatly appreciated.  
> 
> 
>         ___________________________________________        
>                     scilab-5.4.0-alpha-1
> 
>                 Consortium Scilab (DIGITEO)
>               Copyright (c) 1989-2011 (INRIA)
>               Copyright (c) 1989-2007 (ENPC)
>         ___________________________________________        
>  
>  
> Startup execution:
>   loading initial environment
> 
> Start CSV read write
> 	Load macros
> 	Load gateways
> 	Load help
> 	Load demos
> 	Type "demo_gui()" and search for "CSV read write" for
> Demonstrations.
> 
> 
> 
> 
> 
> 
>       ___________________________________________        
>      
>                scilab-5.4.0-beta-2
> 
>                     Scilab Enterprises
>                 Consortium Scilab (DIGITEO)
>        Copyright (c) 2011-2012 (Scilab Enterprises)
>               Copyright (c) 1989-2012 (INRIA)
>               Copyright (c) 1989-2007 (ENPC)
>         ___________________________________________        
>  
>  
> Startup execution:
>   loading initial environment
> 
> Start CSV read write
> 	Load macros
> 	Load gateways
> atomsLoad: An error occurred while loading 'csv_readwrite-0.6-0':
> 	link: The shared archive was not loaded: A dynamic link library (DLL) 
initialization
> routine failed.
> 
> 
> 
> 
> 
> 
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.