* bug 6940 fixed - An error message was wrong in 'pvm_send'.
+* bug 6946 fixed - information about optional input arguments 'column separator'
+ and 'decimal mark' were missing in the write_csv documentation.
+
* bug 6947 fixed - Some demos in "Optimization and Simulation" failed,
without write rights in SCI subdirectory.
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2009 - DIGITEO - Allan CORNET
+ * Copyright (C) 2009-2010 - DIGITEO - Allan CORNET
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
<refsynopsisdiv>
<title>Calling Sequence</title>
- <synopsis>write_csv(M, filename)</synopsis>
+ <synopsis>write_csv(M, filename [,sep, dec])</synopsis>
</refsynopsisdiv>
<refsection>
<para>a matrix of strings.</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term>sep</term>
+
+ <listitem>
+ <para>column separator mark, by default a tabulation: ascii(9)</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>dec</term>
+
+ <listitem>
+ <para>decimal mark '.' or ',' by default a ','</para>
+ </listitem>
+ </varlistentry>
+
+
</variablelist>
</refsection>
<para>write_csv(M, filename) writes matrix M into filename as
comma-separated values. The filename input is a string.</para>
+ <para>if the file 'filename' already exists, it is overwritten.</para>
</refsection>
<refsection>
r = read_csv(TMPDIR + '/datas.csv',ascii(9));
r = strsubst(r,',','.');
-evstr(r)</programlisting>
+evstr(r)
+
+A = [1:10] * 0.1;
+write_csv(A', TMPDIR+'/foo.csv', ' ', '.');
+mgetl(TMPDIR+'/foo.csv')
+
+</programlisting>
</refsection>
<refsection>
<member><link linkend="evstr">evstr</link></member>
<member><link linkend="mgetl">mgetl</link></member>
+
+ <member><link linkend="format">format</link></member>
</simplelist>
</refsection>
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2008 - INRIA
-// Copyright (C) 2009 - DIGITEO - Allan CORNET
+// Copyright (C) 2009-2010 - DIGITEO - Allan CORNET
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
sep = ascii(9);
end
+ if sep == '\t' then
+ sep = ascii(9);
+ end
+
if exists('dec','local') == 0 then
dec = ',';
end
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
+// Copyright (C) 2008-2010 - DIGITEO - Allan CORNET
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
40 41 42 43 44 45 46 47 48 49 ];
write_csv(ref1, TMPDIR + '/test.csv');
res = read_csv( TMPDIR + '/test.csv');
-if and(evstr(res) <> ref1) then bugmes();quit;end
+if or(evstr(res) <> ref1) then bugmes();quit;end
+write_csv(ref1, TMPDIR + '/test2.csv', ' ', '.');
+res = read_csv( TMPDIR + '/test2.csv', ' ');
+if or(evstr(res) <> ref1) then bugmes();quit;end
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
+// Copyright (C) 2008-2010 - DIGITEO - Allan CORNET
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
write_csv(ref1, TMPDIR + '/test.csv');
res = read_csv( TMPDIR + '/test.csv');
-if and(evstr(res) <> ref1) then pause,end
\ No newline at end of file
+if or(evstr(res) <> ref1) then pause, end
+
+write_csv(ref1, TMPDIR + '/test2.csv', ' ', '.');
+res = read_csv( TMPDIR + '/test2.csv', ' ');
+
+if or(evstr(res) <> ref1) then pause, end