diff options
Diffstat (limited to 'modules/spreadsheet/help')
31 files changed, 4226 insertions, 0 deletions
diff --git a/modules/spreadsheet/help/en_US/addchapter.sce b/modules/spreadsheet/help/en_US/addchapter.sce new file mode 100755 index 000000000..5595d00ad --- /dev/null +++ b/modules/spreadsheet/help/en_US/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Spreadsheet",SCI+"/modules/spreadsheet/help/en_US",%T); + diff --git a/modules/spreadsheet/help/en_US/csvDefault.xml b/modules/spreadsheet/help/en_US/csvDefault.xml new file mode 100755 index 000000000..3898b6e54 --- /dev/null +++ b/modules/spreadsheet/help/en_US/csvDefault.xml @@ -0,0 +1,250 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (C) 2010-2011 - INRIA - Allan CORNET + * Copyright (C) 2011 - INRIA - Michael Baudin + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + --> +<refentry version="5.0-subset Scilab" xml:id="csvDefault" xml:lang="en" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns3="http://www.w3.org/1999/xhtml" + xmlns:mml="http://www.w3.org/1998/Math/MathML" + xmlns:db="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>csvDefault</refname> + + <refpurpose>Get or set defaults behavior for csv files.</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <title>Calling Sequence</title> + + <synopsis>allvalues = csvDefault() </synopsis> + + <synopsis>value = csvDefault(field) </synopsis> + + <synopsis>bRes = csvDefault(field, value) </synopsis> + </refsynopsisdiv> + + <refsection> + <title>Parameters</title> + + <variablelist> + <varlistentry> + <term>allvalues</term> + + <listitem> + <para>a 6-by-2 matrix of strings, the values of all the fields. The + first column contains the available fields, while the second column + contains the current values. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>field</term> + + <listitem> + <para>a 1-by-1 matrix of strings, the name of the field to get or + set. The available values of <literal>field</literal> are + "separator", "decimal", "conversion", "precision", "regexp", "eol", + "encoding", "blank". + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>value</term> + + <listitem> + <para>a 1-by-1 matrix of strings, the value of the field to get or + set. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>bRes</term> + + <listitem> + <para>a 1-by-1 matrix of booleans, bRes is true if the value was + correctly set, bRes is wrong is the value was not correct. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + + <refsection> + <title>Description</title> + + <para>This function allows to quiery or configure the options of the csv + files. These options are used by the read and write function when the user + does not specify them in the calling sequence. + </para> + + <para> + The <literal>allvalues = csvDefault()</literal> calling sequence + returns the value of all the fields. + </para> + + <para> + The <literal>value = csvDefault(field)</literal> calling sequence + returns the value corresponding to the given field. + </para> + + <para> + The <literal>bRes = csvDefault(field, value)</literal> calling + sequence allows to set the value of the given field. <itemizedlist> + <listitem> + <para>If the function cannot set the field to the given value, then + <literal>bRes</literal> is false. In this case, the value of the + field is unchanged. + </para> + </listitem> + + <listitem> + <para>If the function is able to change the field to the given + value, then <literal>bRes</literal> is true. + </para> + </listitem> + </itemizedlist> + </para> + + <para>The available fields are the following. <itemizedlist> + <listitem> + <para>field = "separator": the separator of the columns of the csv + files. Default separator = ",". + </para> + </listitem> + + <listitem> + <para>field = "decimal": the decimal point used in the csv files. + The available values are "." or ",". Default decimal = ".". + </para> + </listitem> + + <listitem> + <para>field = "conversion": the type of the output of the + <literal>csvRead</literal>function. Possible values are "string" or + "double". Default conversion = "double". If conversion = "string", + then the <literal>csvRead</literal> function returns a matrix of + strings. If conversion = "double", then the + <literal>csvRead</literal> function returns a matrix of + doubles. + </para> + </listitem> + + <listitem> + <para>field = "precision": the C format used to create the strings + from the doubles in the <literal>csvWrite</literal> function. The + default value is <literal>precision="%.17lg"</literal>. This format + allows to perform write-read error-free cycles. This means that we + can save a double into a .csv, then read the double and get the + exact same value. The supported format is: %type or + %[width].[precision]type. <itemizedlist> + <listitem> + <para>type: lf, lg, d, i, e, f, g</para> + </listitem> + + <listitem> + <para>width: Optional number that specifies the minimum number + of characters output. + </para> + </listitem> + + <listitem> + <para>precision: Optional number that specifies the maximum + number of characters printed for all or part of the output + field, or the minimum number of digits printed for integer + values. + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + + <listitem> + <para>field = "regexp": regular expression used to extract comments + of the <literal>csvRead</literal>function. + </para> + + <para>by default, this value is '' (no regexp).</para> + </listitem> + + <listitem> + <para>field = "eol": end of line used to write lines of the + <literal>csvWrite</literal>function. + </para> + + <para>Possible values are "linux", "windows", "macos9".</para> + + <para>by default, this value is platform-dependant.</para> + </listitem> + + <listitem> + <para>field = "encoding":</para> + + <para>Possible values are "utf-8", "iso-latin".</para> + + <para>by default, this value is "utf-8".</para> + </listitem> + + <listitem> + <para>field = "blank": remove all blank lines before to parse + text + </para> + + <para>Possible values are "on", "off".</para> + + <para>by default, this value is "on".</para> + </listitem> + </itemizedlist> + </para> + </refsection> + + <refsection> + <title>Examples</title> + + <programlisting role="example">// See all the available fields + allvalues = csvDefault() + // Get the value of the "precision" field + value = csvDefault("precision") + // Set the value of the "precision" field + bRes = csvDefault("precision","%.17e") // Expected = %t + // Set the value of the "precision" field to + // an impossible value + bRes = csvDefault("precision","Ouch!") // Expected = %f + </programlisting> + </refsection> + + <refsection> + <title>See Also</title> + + <simplelist type="inline"> + <member> + <link linkend="csvRead">csvRead</link> + </member> + + <member> + <link linkend="csvWrite">csvWrite</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>Function introduced. Based on the 'csv_readwrite' module.</revremark> + </revision> + <revision> + <revnumber>5.4.1</revnumber> + <revremark>'blank' is enabled by default.</revremark> + </revision> + + </revhistory> + </refsection> +</refentry> + diff --git a/modules/spreadsheet/help/en_US/csvRead.xml b/modules/spreadsheet/help/en_US/csvRead.xml new file mode 100755 index 000000000..b5bff83c9 --- /dev/null +++ b/modules/spreadsheet/help/en_US/csvRead.xml @@ -0,0 +1,395 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (C) 2010-2011 - INRIA - Allan CORNET + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + --> +<refentry version="5.0-subset Scilab" xml:id="csvRead" xml:lang="en" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns3="http://www.w3.org/1999/xhtml" + xmlns:mml="http://www.w3.org/1998/Math/MathML" + xmlns:db="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>csvRead</refname> + <refpurpose>Read comma-separated value file</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis> + M = csvRead(filename) + M = csvRead(filename, separator) + M = csvRead(filename, separator, decimal) + M = csvRead(filename, separator, decimal, conversion) + M = csvRead(filename, separator, decimal, conversion, substitute) + M = csvRead(filename, separator, decimal, conversion, substitute, regexpcomments, range) + M = csvRead(filename, separator, decimal, conversion, substitute, regexpcomments, range, header) + [M, comments] = csvRead(filename, separator, decimal, conversion, substitute, regexpcomments, range, header) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>filename</term> + <listitem> + <para>a 1-by-1 matrix of strings, the file path.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>separator</term> + <listitem> + <para>a 1-by-1 matrix of strings, the field separator used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>decimal</term> + <listitem> + <para>a 1-by-1 matrix of strings, the decimal used.</para> + <para> + If <literal>decimal</literal> is different of <literal>[]</literal> and <literal>conversion</literal> is set to <literal>string</literal>, the decimal conversion will be done. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>conversion</term> + <listitem> + <para>a 1-by-1 matrix of strings, the type of the output + <literal>M</literal>. Available values are "string" or "double" (by default). + </para> + <para> + Note that <link linkend="read_csv">read_csv</link> has "string" as default. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>substitute</term> + <listitem> + <para>a m-by-2 matrix of strings, a replacing map (default = [], + meaning no replacements). The first column + <literal>substitute(:,1)</literal> contains the searched strings and + the second column <literal>substitute(:,2)</literal> contains the + replace strings. Every occurence of a searched string in the file is + replaced. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>regexpcomments</term> + <listitem> + <para>a string: a regexp to remove lines which match. (default: + []) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>range</term> + <listitem> + <para>a 1-by-4 matrix of floating point integers, the range of rows + and columns which must be read (default range=[], meaning that all + the rows and columns). Specify range using the format <literal>[Row1 Column1 Row2 Column2] + </literal> + where (R1,C1) is the upper left corner of the + data to be read and (R2,C2) is the lower right corner. + </para> + <para> + <note>Note that the file has to be correctly formated. The range will be done in the memory on the parsed elements.</note> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>header</term> + <listitem> + <para>a 1-by-1 matrix of floating point integers, the number of lines to be ignored + at the beginning of the file. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>M</term> + <listitem> + <para>a m-by-n matrix of strings or double.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>comments</term> + <listitem> + <para>a m-by-n matrix of strings matched by regexp.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>Given an ascii file with comma separated values delimited fields, + this function returns the corresponding Scilab matrix of strings or + doubles. + </para> + <para>For example, the .csv data file may have been created by a + spreadsheet software using "Text and comma" format. + </para> + <para>It might happen that the columns are separated by a non-comma + separator. In this case, use csvRead(filename, separator) for another + choice of separator. + </para> + <para>The default value of the optional input arguments are defined by the + <literal>csvDefault</literal> function. + </para> + <para>Any optional input argument equal to the empty matrix + <literal>[]</literal> is set to its default value. + </para> + <para>When the input argument "conversion" is equal to "double", the + non-numeric fields within the .csv (e.g. strings) are converted into + NaN. + </para> + <para>csvRead is able to handle both UTF-8 and ASCII text files. + </para> + </refsection> + <refsection> + <title>Examples</title> + <para>The following script presents some basic uses of the + <literal>csvRead</literal> function. + </para> + <programlisting role="example"><![CDATA[// Create a file with some data separated with tabs. +M = 1:50; +filename = fullfile(TMPDIR, "data.csv"); +csvWrite(M, filename, ascii(9), '.'); + +// read csv file +M1 = csvRead(filename,ascii(9), [], 'string') + +// Returns a double +M2 = csvRead(filename,ascii(9), '.', 'double') + +// Compares original data and result. +and(M == M2) + +// Use the substitude argument to manage +// special data files. +content = [ +"1" +"Not-A-Number" +"2" +"Not-A-Number" +]; + +substitute = [ +"Not-A-Number" "Nan" +]; + +mputl(content,filename); +M = csvRead(filename,",",".","double",substitute) +isnan(M(2,1)) // Expected=%t +isnan(M(4,1)) // Expected=%t + + ]]></programlisting> + <para>The following script presents more practical uses of the + <literal>csvRead</literal> function. + </para> + <programlisting role="example"><![CDATA[// Define a matrix of strings +Astr = [ +"1" "8" "15" "22" "29" "36" "43" "50" +"2" "9" "16" "23" "30" "37" "44" "51" +"3" "10" "17" "6+3*I" "31" "38" "45" "52" +"4" "11" "18" "25" "32" "39" "46" "53" +"5" "12" "19" "26" "33" "40" "47" "54" +"6" "13" "20" "27" "34" "41" "48" "55" +"+0" "-0" "Inf" "-Inf" "Nan" "1.D+308" "1.e-308" "1.e-323" +]; + +// Create a file with some data separated with commas +filename = fullfile(TMPDIR , 'foo.csv'); +sep = ","; +fd = mopen(filename,'wt'); +for i = 1 : size(Astr,"r") + mfprintf(fd,"%s\n",strcat(Astr(i,:),sep)); +end +mclose(fd); +// To see the file: edit(filename) + +// Read this file +Bstr = csvRead ( filename ) + +// Create a file with a particular separator: here ";" +filename = fullfile(TMPDIR , 'foo.csv'); +sep = ";"; +fd = mopen(filename,'wt'); +for i = 1 : size(Astr,"r") + mfprintf(fd,"%s\n",strcat(Astr(i,:),sep)); +end +mclose(fd); + +// +// Read the file and customize the separator +csvRead ( filename , sep ) + ]]></programlisting> + <para>The following script shows how to remove lines with regexp argument + of the <literal>csvRead</literal> function. + </para> + <programlisting role="example"><![CDATA[ +CSV = ["// tata"; .. +"1,0,0,0,0"; .. +"// titi"; .. +"0,1,0,0,0"; .. +"// toto"; .. +"0,0,1,0,0"; .. +"// tutu"]; +filename = fullfile(TMPDIR , 'foo.csv'); +mputl(CSV, filename); + +// remove lines with // @ beginning +[M, comments] = csvRead(filename, [], [], [], [], '/\/\//') + ]]></programlisting> + </refsection> + <refsection> + <para>Empty field are managed by csvRead</para> + <programlisting role="example"><![CDATA[ +csvWrite(['1','','3';'','','6'], TMPDIR + "/example.csv") +csvRead(TMPDIR + "/example.csv", [], [], "string") +csvRead(TMPDIR + "/example.csv", [], [], "double") + ]]></programlisting> + </refsection> + <programlisting role="example"><![CDATA[ +// Define a matrix of strings +Astr = [ +"1" "8" "15" "22" "29" "36" "43" "50" +"2" "9" "16" "23" "30" "37" "44" "51" +"3" "10" "17" "6+3*I" "31" "38" "45" "52" +"4" "11" "18" "25" "32" "39" "46" "53" +"5" "12" "19" "26" "33" "40" "47" "54" +"6" "13" "20" "27" "34" "41" "48" "55" +"+0" "-0" "Inf" "-Inf" "Nan" "1.D+308" "1.e-308" "1.e-323" +]; + +// Create a file with some data separated with commas +filename = fullfile(TMPDIR , 'foo.csv'); +sep = ","; +fd = mopen(filename,'wt'); +for i = 1 : size(Astr,"r") + mfprintf(fd,"%s\n",strcat(Astr(i,:),sep)); +end +mclose(fd); +// To see the file: edit(filename) + +// Read this file +Bstr = csvRead ( filename ) + +// Create a file with a particular separator: here ";" +filename = fullfile(TMPDIR , 'foo.csv'); +sep = ";"; +fd = mopen(filename,'wt'); +for i = 1 : size(Astr,"r") + mfprintf(fd,"%s\n",strcat(Astr(i,:),sep)); +end +mclose(fd); +// +// Read the file and customize the separator +csvRead ( filename , sep ) + ]]></programlisting> + <refsection> + <para>In the following script, the file "filename" is read by blocks of + 5000 rows. The algorithm stops when the number of rows actually read from + the file differ from 5000, i.e. when the end of the file has been + reached. + </para> + <programlisting role="example"><![CDATA[blocksize = 5000; +C1 = 1; +C2 = 3; +iblock = 1 +while (%t) +R1 = (iblock-1) * blocksize + 1; +R2 = blocksize + R1-1; +irange = [R1 C1 R2 C2]; +mprintf("Block #%d, rows #%d to #%d\n",iblock,R1,R2); +tic(); +M=csvRead(filename , [] , [] , [] , [] , [] , [] , irange ); +t = toc(); +nrows = size(M,"r"); +ncols = size(M,"c"); +if ( nrows > 0 ) then +p = t/(nrows*ncols)*1.e6; +mprintf(" Actual #rows=%d\n",nrows); +mprintf(" T=%.3f (s)\n",t); +mprintf(" T=%.1f (ms/cell)\n",p); +end +if ( nrows < blocksize ) then +mprintf("... End of the file.\n"); +break +end +iblock = iblock + 1; +end + ]]></programlisting> + <para>This produces:</para> + <programlisting role="no-scilab-exec"><![CDATA[Block #1, rows #1 to #5000 +Actual #rows=5000 +T=3.135 (s) +T=209.0 (ms/cell) +Block #2, rows #5001 to #10000 +Actual #rows=5000 +T=3.139 (s) +T=209.3 (ms/cell) +Block #3, rows #10001 to #15000 +Actual #rows=5000 +T=3.151 (s) +T=210.1 (ms/cell) +etc.... + ]]></programlisting> + Example with range + <programlisting role="example"><![CDATA[ +CSV = ["1,0,0,0,0"; .. +"0,1,0,0,0"; .. +"0,0,1,0,0"; .. +"4,4,1,2,0"; .. +"4,63,1,2,0"; .. +"4,63,1,4,233"; .. +"42,3,23,2,23"; .. +]; +filename = fullfile(TMPDIR , 'foo.csv'); +mputl(CSV, filename); +// Extract a subset of the csv file +csvRead(filename, [], [], "double", [], [], [5 3 7 6]) + ]]></programlisting> + Example with header + <programlisting role="example"><![CDATA[ +comments = [ +"// Copyright (C) INRIA" +"// This file must be used under the terms of the CeCILL."]; +filename = fullfile(TMPDIR , 'foo.csv'); +csvWrite(rand(2,3), filename, ascii(9), ",", [], comments); + +header = 2; +[M, c] = csvRead(filename, ascii(9), ",", "double", [], [], [], header) // Ignore the two first lines (the header) + ]]></programlisting> + </refsection> + <refsection> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="csvWrite">csvWrite</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark> + Function introduced. Based on the 'csv_readwrite' module. The only difference in the behavior compared to <link linkend="read_csv">read_csv</link> is that csvRead will try to convert value to double by default when read_csv will return value as string. + </revremark> + </revision> + <revision> + <revnumber>5.4.1</revnumber> + <revremark> + If <literal>decimal</literal> is different of <literal>[]</literal> and <literal>conversion</literal> is set to <literal>string</literal>, the decimal conversion will be done. + </revremark> + </revision> + <revision> + <revnumber>5.5</revnumber> + <revremark> + Addition of the "header" input argument, to ignore headers. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/en_US/csvTextscan.xml b/modules/spreadsheet/help/en_US/csvTextscan.xml new file mode 100755 index 000000000..7030d3aa3 --- /dev/null +++ b/modules/spreadsheet/help/en_US/csvTextscan.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +* Copyright (C) 2010-2011 - INRIA - Allan CORNET +* Copyright (C) 2011 - INRIA - Michael Baudin +* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +--> +<refentry version="5.0-subset Scilab" xml:id="csvTextScan" xml:lang="en" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns3="http://www.w3.org/1999/xhtml" + xmlns:mml="http://www.w3.org/1998/Math/MathML" + xmlns:db="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>csvTextScan</refname> + + <refpurpose>Convert a comma-separated value to a matrix</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <title>Calling Sequence</title> + + <synopsis> + A = csvTextScan(M) + A = csvTextScan(M, separator) + A = csvTextScan(M, separator, decimal) + A = csvTextScan(M, separator, decimal, conversion) + A = csvTextScan(M, separator, decimal, conversion, range) + </synopsis> + </refsynopsisdiv> + + <refsection> + <title>Parameters</title> + + <variablelist> + <varlistentry> + <term>M</term> + + <listitem> + <para>a m-by-1 or 1-by-m matrix of strings.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>separator</term> + + <listitem> + <para>a 1-by-1 matrix of strings, the column separator mark.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>decimal</term> + + <listitem> + <para>a 1-by-1 matrix of strings, the decimal mark. The available + values are "." or ",". + </para> + <para> + If <literal>decimal</literal> is different of <literal>[]</literal> and <literal>conversion</literal> is set to <literal>string</literal>, the decimal conversion will be done. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>conversion</term> + + <listitem> + <para>a 1-by-1 matrix of strings, the type of the output + <literal>A</literal>. Available values are "string" or + "double". + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>range</term> + + <listitem> + <para>a 1-by-4 or 4-by-1 matrix of floating point integers, the + range of rows and columns which must be read (default range=[], + meaning that all the rows and columns). Specify range using the + format <literal>[R1 C1 R2 C2]</literal> where (R1,C1) is the upper + left corner of the data to be read and (R2,C2) is the lower right + corner. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>A</term> + + <listitem> + <para>a m-by-n matrix of strings or double.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + + <refsection> + <title>Description</title> + + <para>Given an ascii file with delimited fields, this function returns the + corresponding Scilab matrix of strings or doubles. + </para> + + <para> + The <literal>csvTextScan</literal> function has the same purpose as + <literal>csvRead</literal>, except that <literal>csvTextScan</literal> + reads in a string, while <literal>csvRead</literal> reads in a + file. + </para> + + <para>The default value of the optional input arguments are defined by the + <literal>csvDefault</literal> function. + </para> + + <para>Any optional input argument equal to the empty matrix + <literal>[]</literal> is set to its default value. + </para> + + <para>When input argument "conversion" is equal to "double", strings are + converted as NaN. + </para> + </refsection> + + <refsection> + <title>Examples</title> + + <programlisting role="example"><![CDATA[ +// convert a csv string matrix to splitted string or double matrix +A = ["1;3 + i"; "Nan;-Inf"] +B = csvTextScan(A,';') +C = csvTextScan(A,';',[],'double') +// +// Configure the decimal mark. +Atext = [ +" 1,000000000D+00; 0,000000000D+00; 2,000000000D+02; Inf; 0,000000000D+00"; +" 1,000000000D+00; 1,00000000D-300; 2,000000000D+02; Inf; 0,000000000D+00"; +" 1,000000000D+00; 1,00000000D-200; 2,000000000D+02; 3,15000000D+300; 1,020000000D+02"; +" 9,999999999D-01; 1,00000000D-100; 2,000000000D+02; 2,960000000D+02; 1,170000000D+02"; +" 1,000000000D+00; Inf;-Inf; Nan; 0,000000000D+00" +]; +csvTextScan( Atext , ";" , "," ) + ]]> + </programlisting> + </refsection> + + <refsection> + <title>See Also</title> + + <simplelist type="inline"> + <member> + <link linkend="csvRead">csvRead</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>Function introduced. Based on the 'csv_readwrite' module.</revremark> + </revision> + <revision> + <revnumber>5.4.1</revnumber> + <revremark> + If <literal>decimal</literal> is different of <literal>[]</literal> and <literal>conversion</literal> is set to <literal>string</literal>, the decimal conversion will be done. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> + diff --git a/modules/spreadsheet/help/en_US/csvWrite.xml b/modules/spreadsheet/help/en_US/csvWrite.xml new file mode 100755 index 000000000..03bece61f --- /dev/null +++ b/modules/spreadsheet/help/en_US/csvWrite.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (C) 2010-2011 - INRIA - Allan CORNET + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + --> +<refentry version="5.0-subset Scilab" xml:id="csvWrite" xml:lang="en" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns3="http://www.w3.org/1999/xhtml" + xmlns:mml="http://www.w3.org/1998/Math/MathML" + xmlns:db="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>csvWrite</refname> + <refpurpose>Write comma-separated value file</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis> + csvWrite(M, filename) + csvWrite(M, filename, separator) + csvWrite(M, filename, separator, decimal) + csvWrite(M, filename, separator, decimal, precision) + csvWrite(M, filename, separator, decimal, precision, comments) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>filename</term> + <listitem> + <para>a 1-by-1 matrix of strings, the file path.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>M</term> + <listitem> + <para>a m-by-n matrix of strings or double (complex + supported). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>separator</term> + <listitem> + <para>a 1-by-1 matrix of strings, the column separator mark.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>decimal</term> + <listitem> + <para>a 1-by-1 matrix of strings, the decimal mark. The available + values are "." or ",". + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>precision</term> + <listitem> + <para>a 1-by-1 matrix of strings, the C format.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>comments</term> + <listitem> + <para>a m-by-1 matrix of strings, the comments stored at the + beginning of the file. This option may be used, for example, to put + a licence header in a data file. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>This function writes matrix M into filename as comma-separated + values. + </para> + <para>The default value of the optional input arguments are defined by the + <literal>csvDefault</literal> function. + </para> + <para>Any optional input argument equal to the empty matrix + <literal>[]</literal> is set to its default value. + </para> + <para> + If the file <literal>filename</literal> already exists, it is + overwritten. + </para> + <para> + If relevant (ie with 'special' characters), the file will be saved as UTF-8. + </para> + </refsection> + <refsection> + <title>Examples</title> + <para>In the following example, we combine the + <literal>csvWrite</literal> and <literal>csvRead</literal> + functions. + </para> + <programlisting role="example"><![CDATA[// Save a matrix as csv file format +M = [1:10] * 0.1; +filename = fullfile(TMPDIR, "data.csv"); +csvWrite(M, filename); + +// Read as text +mgetl(filename) + +r = csvRead(filename); + ]]></programlisting> + <para>In the following example, we use various options of the + <literal>csvWrite</literal> function. + </para> + <programlisting role="example"><![CDATA[// Save a matrix as csv file format +M = rand(2,3); +filename = fullfile(TMPDIR, "data.csv"); +// +// Use tabs as the separator +csvWrite(M, filename,ascii(9)); +mgetl(filename) +// +// Use the "," as the decimal point +// (and blank space as the separator). +csvWrite(M, filename," ",","); +mgetl(filename) +// +// Configure the precision. +// Caution: this lower precision may generate +// errors in a write-read cycle! +csvWrite(M, filename,[],[],"%.8e"); +mgetl(filename) +// +// Configure the comments +comments = [ +"// Copyright (C) INRIA" +"// This file must be used under the terms of the CeCILL." +]; +csvWrite(M, filename,[],[],[],comments); +mgetl(filename) + ]]></programlisting> + <para>The following examples are more advanced uses of the + <literal>csvWrite</literal> function. + </para> + <programlisting role="example"><![CDATA[A = [ +1 0 200 %inf 0 +1 1.e-300 200 %inf 0 +9.99999999999990010e-001 9.99999999999999980e-201 200 3.15e300 102 +9.99999999899999990e-001 1.e-100 200 296 117 +1 %inf -%inf %nan 0 +]; + +// Write into a file +filename=fullfile(TMPDIR,"foo.csv"); +csvWrite ( A , filename ); +edit(filename) + ]]></programlisting> + </refsection> + <refsection> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="csvRead">csvRead</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>Function introduced. Based on the 'csv_readwrite' module.</revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/en_US/read_csv.xml b/modules/spreadsheet/help/en_US/read_csv.xml new file mode 100755 index 000000000..1c2d0bcff --- /dev/null +++ b/modules/spreadsheet/help/en_US/read_csv.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2009 - 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 + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="read_csv" scilab:needs-examples="no" xml:lang="en"> + <refnamediv> + <refname>read_csv</refname> + <refpurpose> + reads comma-separated value file. Outclassed by <link linkend="csvRead">csvRead</link> + </refpurpose> + </refnamediv> + <refsection> + <title>Description</title> + <para> + Unlike <link linkend="csvRead">csvRead</link>, the conversion is set to <literal>string</literal> by default to insure the compatibility with previous versions. + </para> + </refsection> + + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark> + read_csv is now fully based on <link linkend="csvRead">csvRead</link>. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> + diff --git a/modules/spreadsheet/help/en_US/readxls.xml b/modules/spreadsheet/help/en_US/readxls.xml new file mode 100755 index 000000000..ab53f8469 --- /dev/null +++ b/modules/spreadsheet/help/en_US/readxls.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="readxls"> + <refnamediv> + <refname>readxls</refname> + <refpurpose>reads an Excel file</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>sheets = readxls(file_path)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>file_path</term> + <listitem> + <para>a character string: the path of the Excel file. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>sheets</term> + <listitem> + <para> + an <literal>mlist</literal> of type <literal>xls</literal>, with one field named <literal>sheets</literal> + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + Given an Excel file path this function returns an <literal>mlist</literal> data structure + of type <literal>xls</literal>, with one field named <literal>sheets</literal>. The + <literal>sheets</literal> field itself contains a list of sheet data structure. + </para> + <para> + <literal>sheet=mlist(['xlssheet','name','text','value'],sheetname,Text,Value)</literal> where + <literal>sheetname</literal> is a character string containing the name of the sheet, + <literal>Text</literal> is a matrix of string which contains the cell's + strings and <literal>Value</literal> is a matrix of numbers which contains the cell's + values. + </para> + <para> + <warning> + Only BIFF8 Excel files (last Excel file version (2003)) are handled. + </warning> + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +Sheets = readxls('SCI/modules/spreadsheet/demos/xls/t1.xls') +// some basic operations on Sheets +typeof(Sheets) +s1=Sheets(1) //get the first sheet +typeof(s1) +s1.value //get the first sheet value field +s1.text //get the first sheet text field +s1(2,:) //get the 2 row of the sheet +typeof(s1(2,:)) + +disp(s1) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="xls_open">xls_open</link> + </member> + <member> + <link linkend="xls_read">xls_read</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>Used Functions</title> + <para> + This function is based on the Scilab functions <literal>xls_open</literal> + and <literal>xls_read</literal>. + </para> + </refsection> +</refentry> + diff --git a/modules/spreadsheet/help/en_US/write_csv.xml b/modules/spreadsheet/help/en_US/write_csv.xml new file mode 100755 index 000000000..9a7714d50 --- /dev/null +++ b/modules/spreadsheet/help/en_US/write_csv.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="write_csv" scilab:needs-examples="no" xml:lang="en"> + <refnamediv> + <refname>write_csv</refname> + <refpurpose> + writes comma-separated value fileOutclassed by <link linkend="csvWrite">csvWrite</link> + </refpurpose> + </refnamediv> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark> + <link linkend="csvWrite">csvWrite</link> provide a better replacement of write_csv. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/en_US/xls_open.xml b/modules/spreadsheet/help/en_US/xls_open.xml new file mode 100755 index 000000000..23c2fb7c5 --- /dev/null +++ b/modules/spreadsheet/help/en_US/xls_open.xml @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="xls_open"> + <refnamediv> + <refname>xls_open</refname> + <refpurpose>opens an Excel file for reading</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>[fd,SST,Sheetnames,Sheetpos] = xls_open(file_path)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>file_path</term> + <listitem> + <para>a character string: the path of the Excel file. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>fd</term> + <listitem> + <para>a number: the logical unit on the Excel stream. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>SST</term> + <listitem> + <para>A vector of all character strings which appear in the Excel sheets. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetnames</term> + <listitem> + <para>a vector of strings: the sheet names. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetpos</term> + <listitem> + <para>a vector of numbers: the position of the beginning of sheets in the + Excel stream. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>This function first analyzes the ole2 data structure associated with the + given file to extract the Excel stream which is included in. After + that the Excel stream is saved in the <literal>TMDIR</literal> directory + and opened. The <literal>fd</literal> logical unit points to this temporary + file. Then the first sheet in this stream is read to get the global information + like number of sheets, sheet names <literal>Sheetnames</literal>, sheet + addresses within the stream <literal>Sheetpos</literal> and the + <literal>SST</literal> which contains all the strings used in the following + sheets. + </para> + <para> + The <literal>fd</literal> and <literal>Sheetpos</literal> data have to be passed to + <link linkend="xls_read">xls_read</link> to read the data sheets. + </para> + <para> + The <link linkend="readxls">readxls</link> function can be used to read all an Excel file + in one function with a single function call. + </para> + <para> + <warning> + Only BIFF8 Excel files (last Excel file version (2003)) are handled. + </warning> + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +//Decode ole file, extract and open Excel stream +[fd,SST,Sheetnames,Sheetpos] = xls_open('SCI/modules/spreadsheet/demos/xls/Test1.xls') +//Read first data sheet +[Value,TextInd] = xls_read(fd,Sheetpos(1)) +//close the spreadsheet stream +mclose(fd) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="xls_read">xls_read</link> + </member> + <member> + <link linkend="readxls">readxls</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>Bibliography</title> + <para>This function is based on the Microsoft ole2 file documentation + (<ulink url="http://chicago.sourceforge.net/devel/docs/ole/">http://chicago.sourceforge.net/devel/docs/ole/</ulink>) and on Excel + stream description from OpenOffice (<ulink url="http://sc.openoffice.org/spreadsheetfileformat.pdf">http://sc.openoffice.org/spreadsheetfileformat.pdf</ulink>). + </para> + </refsection> + <refsection> + <title>Used Functions</title> + <para> + The ripole-0.1.4 procedure (<ulink url="http://www.pldaniels.com/ripole">http://www.pldaniels.com/ripole</ulink>) is used + to extract the spreadsheet stream out of the ole file. + </para> + </refsection> +</refentry> + diff --git a/modules/spreadsheet/help/en_US/xls_read.xml b/modules/spreadsheet/help/en_US/xls_read.xml new file mode 100755 index 000000000..0aa5c35d6 --- /dev/null +++ b/modules/spreadsheet/help/en_US/xls_read.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="xls_read"> + <refnamediv> + <refname>xls_read</refname> + <refpurpose>reads a sheet in an Excel file</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>[Value,TextInd] = xls_read(fd,Sheetpos)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>fd</term> + <listitem> + <para> + a number: the logical unit on the Excel stream returned by <link linkend="xls_open">xls_open</link>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetpos</term> + <listitem> + <para> a number: the position of the beginning of the sheet in the + Excel stream. This position is one of those returned by <link linkend="xls_open">xls_open</link>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Value</term> + <listitem> + <para>a matrix of numbers: the numerical data found in the sheet. The cells + without numerical data are represented by <literal>NaN</literal> values. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>TextInd</term> + <listitem> + <para> + a matrix of indices with the same size as <literal>Value</literal>. The 0 + indices indicates that no string exists in the corresponding Excel + cell. A positive index <literal>i</literal> points to the string + <literal>SST(i)</literal> where <literal>SST</literal> is given by <link linkend="xls_open">xls_open</link>. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + This function reads an Excel sheet given a logical unit on an Excel stream + and the position of the beginning of the sheet within this stream. It + returns the numerical data and the strings contained by the Excel cells. + </para> + <para> + The <link linkend="readxls">readxls</link> function can be used to read all an Excel file + in one function with a single function call. + </para> + <para> + <warning> + Only BIFF8 Excel files (last Excel file version (2003)) are handled. + </warning> + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +//Decode ole file, extract and open Excel stream +[fd,SST,Sheetnames,Sheetpos] = xls_open('SCI/modules/spreadsheet/demos/xls/Test1.xls') +//Read first data sheet +[Value,TextInd] = xls_read(fd,Sheetpos(1)) +//close the spreadsheet stream +mclose(fd) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="xls_open">xls_open</link> + </member> + <member> + <link linkend="readxls">readxls</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>Bibliography</title> + <para>This function is based on Excel + stream description from OpenOffice (<ulink url="http://sc.openoffice.org/spreadsheetfileformat.pdf">http://sc.openoffice.org/spreadsheetfileformat.pdf</ulink>). + </para> + </refsection> + <refsection> + <title>Used Functions</title> + <para> + This function uses the xls.c file which can be found in a Scilab source + version in the directory SCIDIR/modules/spreadsheet/src/c. + </para> + </refsection> +</refentry> + diff --git a/modules/spreadsheet/help/fr_FR/addchapter.sce b/modules/spreadsheet/help/fr_FR/addchapter.sce new file mode 100755 index 000000000..b4cdbfe5e --- /dev/null +++ b/modules/spreadsheet/help/fr_FR/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Tableur",SCI+"/modules/spreadsheet/help/fr_FR",%T); + diff --git a/modules/spreadsheet/help/ja_JP/addchapter.sce b/modules/spreadsheet/help/ja_JP/addchapter.sce new file mode 100755 index 000000000..edf6b3972 --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Spreadsheet",SCI+"/modules/spreadsheet/help/ja_JP",%T); + diff --git a/modules/spreadsheet/help/ja_JP/csvDefault.xml b/modules/spreadsheet/help/ja_JP/csvDefault.xml new file mode 100755 index 000000000..247ec0f4f --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/csvDefault.xml @@ -0,0 +1,229 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (C) 2010-2011 - INRIA - Allan CORNET + * Copyright (C) 2011 - INRIA - Michael Baudin + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + --> +<refentry version="5.0-subset Scilab" xml:id="csvDefault" xml:lang="ja" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns3="http://www.w3.org/1999/xhtml" + xmlns:mml="http://www.w3.org/1998/Math/MathML" + xmlns:db="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>csvDefault</refname> + <refpurpose>CSVファイルに関するデフォルト動作を取得/設定.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>呼び出し手順</title> + <synopsis>allvalues = csvDefault() </synopsis> + <synopsis>value = csvDefault(field) </synopsis> + <synopsis>bRes = csvDefault(field, value) </synopsis> + </refsynopsisdiv> + <refsection> + <title>パラメータ</title> + <variablelist> + <varlistentry> + <term>allvalues</term> + <listitem> + <para>6行2列の文字列行列で, 全フィールドの値です. + 最初の列には利用可能なフィールドが含まれ, + 2番目の列には現在の値が含まれます. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>field</term> + <listitem> + <para>1行1列の文字列行列で, + 取得または設定したフィールドの名前です. + <literal>field</literal>で利用可能な値は, + "separator", "decimal", "conversion", "precision", "regexp", "eol", + "encoding", "blank"です. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>value</term> + <listitem> + <para> + 1行1列の文字列行列で, + 取得または設定したフィールドの値です. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>bRes</term> + <listitem> + <para> + 1行1列の論理値行列で, + 値が正しく設定された場合は bResがtrueとなり, + そうでない場合はbResがfalseとなります. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>説明</title> + <para> + この関数によりCSVファイルのオプションを調べたり,設定 + することができます. + これらのオプションはユーザが呼び出し時に指定しない場合に + 読み書き用の関数で使用されます. + </para> + <para> + 呼び出し手順 <literal>allvalues = csvDefault()</literal> は + 全フィールドの値を返します. + </para> + <para> + 呼び出し手順 <literal>value = csvDefault(field)</literal> は + 指定したフィールドに対応する値を返します. + </para> + <para> + 呼び出し手順 <literal>bRes = csvDefault(field, value)</literal> + により, 指定したフィールドに値を設定できます. + <itemizedlist> + <listitem> + <para> + 関数がフィールドに指定した値を設定できない場合, + <literal>bRes</literal> はfalseとなります. この場合, + フィールドの値は変更されません. + </para> + </listitem> + <listitem> + <para> + 関数が指定した値にフィールドを変更できた場合, + <literal>bRes</literal> は trueとなります. + </para> + </listitem> + </itemizedlist> + </para> + <para> + 利用可能なフィールドを以下に示します. <itemizedlist> + <listitem> + <para>field = "separator": CSVファイルにおける列の + セパレータ. デフォルトのセパレータ = ",". + </para> + </listitem> + <listitem> + <para>field = "decimal": CSVファイルで使用される小数点. + 利用可能な値は "." または "," です. + デフォルトの小数点 = '.'. + </para> + </listitem> + <listitem> + <para>field = "conversion": + <literal>csvRead</literal>関数の出力型. 指定可能な値は + "string" または"double"です. + conversionのデフォルト値 = "double". + conversion = "string"の場合, + <literal>csvRead</literal> 関数は文字列の行列を + 返します. + conversion = "double"の場合, + <literal>csvRead</literal> 関数はdoubleの行列を + 返します. + </para> + </listitem> + <listitem> + <para>field = "precision": + <literal>csvWrite</literal>関数のdoubleから + 文字列を生成する際に使用されるCフォーマット. + デフォルト値は <literal>precision="%.17lg"</literal>です. + このフォーマットにより読み書きエラーフリーサイクル + を実行できます. + これは,doubleを.csvに保存してから,doubleを読み込むと, + 正しく同じ値が取得できることを意味します. + サポートされる形式を以下に示します: %type または + %[幅].[精度]型. + <itemizedlist> + <listitem> + <para>型: lf, lg, d, i, e, f, g</para> + </listitem> + <listitem> + <para>幅: オプションの数値で,出力文字の最小値を指定します. + </para> + </listitem> + <listitem> + <para>精度: + オプションの数値で, + 出力フィールドの全てまたは一部を出力する際の + 最大文字数,または + 整数値を出力する際の最小桁数を指定します. + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para>field = "regexp": + <literal>csvRead</literal>関数のコメントを + 展開する際に使用する正規表現式. + </para> + <para>デフォルトでは, この値は'' (正規表現なし)です.</para> + </listitem> + <listitem> + <para>field = "eol": + <literal>csvWrite</literal>関数で行を書き込む際に + 使用される改行. + </para> + <para> + 指定可能な値は"linux", "windows", "macos9"です. + </para> + <para>デフォルトでは, この値はプラットフォーム依存です.</para> + </listitem> + <listitem> + <para>field = "encoding":</para> + <para>指定可能な値は"utf-8", "iso-latin"です.</para> + <para>デフォルトでは, この値は"utf-8"です.</para> + </listitem> + <listitem> + <para>field = "blank": テキストをパースする前に + 空白行を全て削除します + </para> + <para>指定可能な値は "on", "off"です.</para> + <para>デフォルトでは, この値は "on"です.</para> + </listitem> + </itemizedlist> + </para> + </refsection> + <refsection> + <title>例</title> + <programlisting role="example">// 利用可能な全フィールドを参照 + allvalues = csvDefault() + // "precision"フィールドの値を取得 + value = csvDefault("precision") + // "precision"フィールドの値を設定 + bRes = csvDefault("precision","%.17e") // 期待値 = %t + // "precision"フィールドに不正な値を設定 + bRes = csvDefault("precision","Ouch!") // 期待値 = %f + </programlisting> + </refsection> + <refsection> + <title>参照</title> + <simplelist type="inline"> + <member> + <link linkend="csvRead">csvRead</link> + </member> + <member> + <link linkend="csvWrite">csvWrite</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>履歴</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>関数が導入されました. 'csv_readwrite'モジュールに + 基づきます. + </revremark> + </revision> + <revision> + <revnumber>5.4.1</revnumber> + <revremark>'blank' がデフォルトで有効となりました.</revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ja_JP/csvRead.xml b/modules/spreadsheet/help/ja_JP/csvRead.xml new file mode 100755 index 000000000..ea00f5cc5 --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/csvRead.xml @@ -0,0 +1,417 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (C) 2010-2011 - INRIA - Allan CORNET + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + --> +<refentry version="5.0-subset Scilab" xml:id="csvRead" xml:lang="ja" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns3="http://www.w3.org/1999/xhtml" + xmlns:mml="http://www.w3.org/1998/Math/MathML" + xmlns:db="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>csvRead</refname> + <refpurpose>CSVファイルを読み込む</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>呼び出し手順</title> + <synopsis> + M = csvRead(filename) + M = csvRead(filename, separator) + M = csvRead(filename, separator, decimal) + M = csvRead(filename, separator, decimal, conversion) + M = csvRead(filename, separator, decimal, conversion, substitute) + M = csvRead(filename, separator, decimal, conversion, substitute, regexpcomments, range) + M = csvRead(filename, separator, decimal, conversion, substitute, regexpcomments, range, header) + [M, comments] = csvRead(filename, separator, decimal, conversion, substitute, regexpcomments, range, header) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>引数</title> + <variablelist> + <varlistentry> + <term>filename</term> + <listitem> + <para>1行1列の文字列行列で,ファイルパスです.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>separator</term> + <listitem> + <para>1行1列の文字列行列で, + 使用されるフィールドセパレータ. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>decimal</term> + <listitem> + <para> + 1行1列の文字列行列で,使用される小数点. + </para> + <para> + <literal>decimal</literal> が <literal>[]</literal> + と異なり + <literal>conversion</literal> が <literal>string</literal>に + 設定された場合,小数点変換が行われます. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>conversion</term> + <listitem> + <para> + 1行1列の文字列行列で,出力<literal>M</literal>の型. + 利用可能な値は "string" または "double" + (デフォルト)です. + </para> + <para> + <link linkend="read_csv">read_csv</link> では "string" がデフォルトであることに + 注意してください. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>substitute</term> + <listitem> + <para> + m行2列の文字列行列で, + 置換マップ(デフォルト = [], 置換処理なし). + 最初の列 + <literal>substitute(:,1)</literal> は + 検索する文字列を有し, + 2番目の列 + <literal>substitute(:,2)</literal> は置換文字列を + 有します. + ファイル中に指定された文字列が現れる度に + 置換が行われます. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>rexgepcomments</term> + <listitem> + <para>文字列: 一致する行を削除するための正規表現. + (デフォルト: + []) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>range</term> + <listitem> + <para>1行4列の浮動小数点の整数行列で, + 読み込む列および行の範囲です + (デフォルトの範囲は [] で,全ての行と列を意味します). + <literal>[R1 C1 R2 C2]</literal>の形式で範囲を + 指定してください. + ただし,(R1,C1)は読み込むデータの左上隅, + (R2,C2)は右下隅です. + </para> + <para> + <note> + ファイルが正しく整形されていることに注意してください. + この範囲はパースされた要素についてメモリ上で実行されます. + </note> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>header</term> + <listitem> + <para> + 1行1列の行列の浮動小数点整数, ファイルの先頭で無視される行の数. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>M</term> + <listitem> + <para>m行n列の文字列またはdouble行列.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>comments</term> + <listitem> + <para>正規表現にマッチしたm行n列の文字列行列.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>説明</title> + <para> + カンマ区切りの値をフィールドとするアスキーファイルを指定すると, + この関数は対応する文字列またはdoubleのScilab行列を返します. + </para> + <para> + 例えば,.csvデータファイルは + 表計算ソフトウェアにより"テキスト及びカンマ"形式で + 作成されたものとすることができます. + </para> + <para> + 列はカンマ以外で区切られたものとすることもできます. + この場合, 別のセパレータを指定する + csvRead(filename, separator) を使用してください. + </para> + <para> + オプションの入力引数のデフォルト値は, + <literal>csvDefault</literal> 関数で定義されます. + </para> + <para> + オプションの入力引数に空の行列<literal>[]</literal>を指定すると, + デフォルト値が設定されます. + </para> + + <para> + 入力引数 "conversion" が "double" の時, + .csvの中の数値以外のフィールド(例:文字列)は NaNに変換されます. + </para> + <para>csvRead は UTF-8 および ASCII テキストファイルを読み込むことができます. + </para> + </refsection> + <refsection> + <title>例</title> + <para> + 以下のスクリプトは, + <literal>csvRead</literal>関数のいくつかの基本的な使用例を示します. + </para> + <programlisting role="example"><![CDATA[// タブ区切りのデータを含むファイルを生成 +M = 1:50; +filename = fullfile(TMPDIR, "data.csv"); +csvWrite(M, filename, ascii(9), '.'); +// csvファイルを読み込む +M1 = csvRead(filename,ascii(9), [], 'string') +// doubleを返す +M2 = csvRead(filename,ascii(9), '.', 'double') +// 元のデータを結果と比較 +and(M == M2) +// 特殊なデータファイルを管理するために +// 置換用引数を使用 +content = [ +"1" +"Not-A-Number" +"2" +"Not-A-Number" +]; +substitute = [ +"Not-A-Number" "Nan" +]; +mputl(content,filename); +M = csvRead(filename,",",".","double",substitute) +isnan(M(2,1)) // Expected=%t +isnan(M(4,1)) // Expected=%t + ]]></programlisting> + <para> + 以下のスクリプトは, + <literal>csvRead</literal>関数のより実用的な使用例を示します. + </para> + <programlisting role="example"><![CDATA[// 文字列の行列を定義 +Astr = [ +"1" "8" "15" "22" "29" "36" "43" "50" +"2" "9" "16" "23" "30" "37" "44" "51" +"3" "10" "17" "6+3*I" "31" "38" "45" "52" +"4" "11" "18" "25" "32" "39" "46" "53" +"5" "12" "19" "26" "33" "40" "47" "54" +"6" "13" "20" "27" "34" "41" "48" "55" +"+0" "-0" "Inf" "-Inf" "Nan" "1.D+308" "1.e-308" "1.e-323" +]; +// カンマ区切りのデータを有するファイルを作成 +filename = fullfile(TMPDIR , 'foo.csv'); +sep = ","; +fd = mopen(filename,'wt'); +for i = 1 : size(Astr,"r") + mfprintf(fd,"%s\n",strcat(Astr(i,:),sep)); +end +mclose(fd); +// ファイルを参照するには: edit(filename) +// このファイルを読み込む +Bstr = csvRead ( filename ) +// 特殊なセパレータを有するファイルを作成: ここでは ";" +filename = fullfile(TMPDIR , 'foo.csv'); +sep = ";"; +fd = mopen(filename,'wt'); +for i = 1 : size(Astr,"r") + mfprintf(fd,"%s\n",strcat(Astr(i,:),sep)); +end +mclose(fd); +// +// セパレータを指定してファイルを読み込む +csvRead ( filename , sep ) + ]]></programlisting> + <para> + 以下のスクリプトは + <literal>csvRead</literal> 関数のregexp引数により + 行を削除する例を示します. + </para> + <programlisting role="example"><![CDATA[ +CSV = ["// tata"; .. +"1,0,0,0,0"; .. +"// titi"; .. +"0,1,0,0,0"; .. +"// toto"; .. +"0,0,1,0,0"; .. +"// tutu"]; +filename = fullfile(TMPDIR , 'foo.csv'); +mputl(CSV, filename); +// @ で始まる行を削除 +[M, comments] = csvRead(filename, [], [], [], [], '/\/\//') + ]]></programlisting> + </refsection> + <refsection> + <para>空のフィールドはcsvReadで管理されます</para> + <programlisting role="example"><![CDATA[ +csvWrite(['1','','3';'','','6'], TMPDIR + "/example.csv") +csvRead(TMPDIR + "/example.csv", [], [], "string") +csvRead(TMPDIR + "/example.csv", [], [], "double") + ]]></programlisting> + </refsection> + <programlisting role="example"><![CDATA[ +// 文字列の行列を定義 +Astr = [ +"1" "8" "15" "22" "29" "36" "43" "50" +"2" "9" "16" "23" "30" "37" "44" "51" +"3" "10" "17" "6+3*I" "31" "38" "45" "52" +"4" "11" "18" "25" "32" "39" "46" "53" +"5" "12" "19" "26" "33" "40" "47" "54" +"6" "13" "20" "27" "34" "41" "48" "55" +"+0" "-0" "Inf" "-Inf" "Nan" "1.D+308" "1.e-308" "1.e-323" +]; +// カンマ区切りのデータを有するファイルを作成 +filename = fullfile(TMPDIR , 'foo.csv'); +sep = ","; +fd = mopen(filename,'wt'); +for i = 1 : size(Astr,"r") + mfprintf(fd,"%s\n",strcat(Astr(i,:),sep)); +end +mclose(fd); +// ファイルを参照するには: edit(filename) +// このファイルを読み込む +Bstr = csvRead ( filename ) +// 特殊なセパレータを有するファイルを作成: ここでは ";" +filename = fullfile(TMPDIR , 'foo.csv'); +sep = ";"; +fd = mopen(filename,'wt'); +for i = 1 : size(Astr,"r") + mfprintf(fd,"%s\n",strcat(Astr(i,:),sep)); +end +mclose(fd); +// +// セパレータを指定してファイルを読み込む +csvRead ( filename , sep ) + ]]></programlisting> + <refsection> + <para> + 以下のスクリプトでは, ファイル "filename" は + 5000行単位のブロックで読みこまれます. + 実際に読み込まれたファイルの行数が5000行に + 満たない時, すなわち, ファイルの終端に達した時, + このアルゴリズムは中断します. + </para> + <programlisting role="example"><![CDATA[blocksize = 5000; +C1 = 1; +C2 = 3; +iblock = 1 +while (%t) +R1 = (iblock-1) * blocksize + 1; +R2 = blocksize + R1-1; +irange = [R1 C1 R2 C2]; +mprintf("Block #%d, rows #%d to #%d\n",iblock,R1,R2); +tic(); +M=csvRead(filename , [] , [] , [] , [] , [] , [] , irange ); +t = toc(); +nrows = size(M,"r"); +ncols = size(M,"c"); +if ( nrows > 0 ) then +p = t/(nrows*ncols)*1.e6; +mprintf(" Actual #rows=%d\n",nrows); +mprintf(" T=%.3f (s)\n",t); +mprintf(" T=%.1f (ms/cell)\n",p); +end +if ( nrows < blocksize ) then +mprintf("... End of the file.\n"); +break +end +iblock = iblock + 1; +end + ]]></programlisting> + <para>出力は以下のようになります :</para> + <programlisting role="no-scilab-exec"><![CDATA[Block #1, rows #1 to #5000 +Actual #rows=5000 +T=3.135 (s) +T=209.0 (ms/cell) +Block #2, rows #5001 to #10000 +Actual #rows=5000 +T=3.139 (s) +T=209.3 (ms/cell) +Block #3, rows #10001 to #15000 +Actual #rows=5000 +T=3.151 (s) +T=210.1 (ms/cell) +etc.... + ]]></programlisting> + 範囲を有する例 + <programlisting role="example"><![CDATA[ +CSV = ["1,0,0,0,0"; .. +"0,1,0,0,0"; .. +"0,0,1,0,0"; .. +"4,4,1,2,0"; .. +"4,63,1,2,0"; .. +"4,63,1,4,233"; .. +"42,3,23,2,23"; .. +]; +filename = fullfile(TMPDIR , 'foo.csv'); +mputl(CSV, filename); +// csvファイルの一部を展開 +csvRead(filename, [], [], "double", [], [], [5 3 7 6]) + ]]></programlisting> + ヘッダを有する例 + <programlisting role="example"><![CDATA[ +comments = [ +"// Copyright (C) INRIA" +"// This file must be used under the terms of the CeCILL."]; +filename = fullfile(TMPDIR , 'foo.csv'); +csvWrite(rand(2,3), filename, ascii(9), ",", [], comments); +header = 2; +[M, c] = csvRead(filename, ascii(9), ",", "double", [], [], [], header) // 最初の2行(ヘッダ)を無視 + ]]></programlisting> + </refsection> + <refsection> + <title>参照</title> + <simplelist type="inline"> + <member> + <link linkend="csvWrite">csvWrite</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>履歴</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>関数が導入されました. + 'csv_readwrite'モジュールに基づきます. + <link linkend="read_csv">read_csv</link> と比べた場合の + 動作の唯一の差異は, + read_csvが値を文字列として返す時,デフォルトで値をdoubleに変換しようとする + ことです. + </revremark> + </revision> + <revision> + <revnumber>5.4.1</revnumber> + <revremark> + <literal>decimal</literal> が <literal>[]</literal> 以外で, + <literal>conversion</literal> が <literal>string</literal>に設定された場合, + 小数点変換が行われます. + </revremark> + </revision> + <revision> + <revnumber>5.5</revnumber> + <revremark> + ヘッダを無視するために,入力引数"header"が追加されました. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ja_JP/csvTextscan.xml b/modules/spreadsheet/help/ja_JP/csvTextscan.xml new file mode 100755 index 000000000..341fa9723 --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/csvTextscan.xml @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (C) 2010-2011 - INRIA - Allan CORNET + * Copyright (C) 2011 - INRIA - Michael Baudin + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + --> +<refentry version="5.0-subset Scilab" xml:id="csvTextScan" xml:lang="ja" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns3="http://www.w3.org/1999/xhtml" + xmlns:mml="http://www.w3.org/1998/Math/MathML" + xmlns:db="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>csvTextScan</refname> + <refpurpose>カンマ区切りの値を行列に変換</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>呼び出し手順</title> + <synopsis> + A = csvTextScan(M) + A = csvTextScan(M, separator) + A = csvTextScan(M, separator, decimal) + A = csvTextScan(M, separator, decimal, conversion) + A = csvTextScan(M, separator, decimal, conversion, range) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>パラメータ</title> + <variablelist> + <varlistentry> + <term>M</term> + <listitem> + <para>m行1列または1行m列の文字列の行列.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>separator</term> + <listitem> + <para>1行1列の文字列行列, 列セパレータ記号.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>decimal</term> + <listitem> + <para>1行1列の文字列行列, 小数点記号. 利用可能な値は + "." または ",". + </para> + <para> + <literal>decimal</literal> が <literal>[]</literal> 以外で + <literal>conversion</literal> が <literal>string</literal> + に設定された場合, 小数点変換が行われます. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>conversion</term> + <listitem> + <para> + 1行1列の文字列行列,出力<literal>A</literal>の型です. + 利用可能な値は"string" または "double"です. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>range</term> + <listitem> + <para> + 1行4列または4行1列の浮動小数点の整数行列で, + 読み込む列および行の範囲です + (デフォルトの範囲は [] で,全ての行と列を意味します). + <literal>[R1 C1 R2 C2]</literal>の形式で範囲を + 指定してください. + ただし,(R1,C1)は読み込むデータの左上隅, + (R2,C2)は右下隅です. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>A</term> + <listitem> + <para>m行n列の文字列またはdouble行列.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>説明</title> + <para> + 区切られたフィールドを有するアスキーファイルを指定すると, + この関数は対応する文字列またはdoubleのScilab行列を返します. + </para> + <para> + <literal>csvTextScan</literal> 関数の用途は + <literal>csvRead</literal>と同じですが, + <literal>csvRead</literal>がファイルから読み込むのに対して, + 文字列から読み込みます. + </para> + <para> + オプションの入力引数のデフォルト値は, + <literal>csvDefault</literal> 関数により定義されます. + </para> + <para> + オプションの入力引数に空の行列<literal>[]</literal>を指定すると, + デフォルト値が設定されます. + </para> + <para> + 入力引数 "conversion" が "double" の時, + .csvの中の数値以外のフィールド(例:文字列)は NaNに変換されます. + </para> + </refsection> + <refsection> + <title>例</title> + <programlisting role="example"><![CDATA[ +// CSV文字列行列を文字列またはdouble行列に変換 +A = ["1;3 + i"; "Nan;-Inf"] +B = csvTextScan(A,';') +C = csvTextScan(A,';',[],'double') +// +// 小数点記号を設定 +Atext = [ +" 1,000000000D+00; 0,000000000D+00; 2,000000000D+02; Inf; 0,000000000D+00"; +" 1,000000000D+00; 1,00000000D-300; 2,000000000D+02; Inf; 0,000000000D+00"; +" 1,000000000D+00; 1,00000000D-200; 2,000000000D+02; 3,15000000D+300; 1,020000000D+02"; +" 9,999999999D-01; 1,00000000D-100; 2,000000000D+02; 2,960000000D+02; 1,170000000D+02"; +" 1,000000000D+00; Inf;-Inf; Nan; 0,000000000D+00" +]; +csvTextScan( Atext , ";" , "," ) + ]]> + </programlisting> + </refsection> + <refsection> + <title>参照</title> + <simplelist type="inline"> + <member> + <link linkend="csvRead">csvRead</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>履歴</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>関数が導入されました. + 'csv_readwrite'モジュールに基づきます. + </revremark> + </revision> + <revision> + <revnumber>5.4.1</revnumber> + <revremark> + <literal>decimal</literal> が <literal>[]</literal> と + 異なり, <literal>conversion</literal> が + <literal>string</literal>に設定された場合, + 小数点変換が行われます. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ja_JP/csvWrite.xml b/modules/spreadsheet/help/ja_JP/csvWrite.xml new file mode 100755 index 000000000..25f408397 --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/csvWrite.xml @@ -0,0 +1,180 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (C) 2010-2011 - INRIA - Allan CORNET + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + --> +<refentry version="5.0-subset Scilab" xml:id="csvWrite" xml:lang="ja" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns3="http://www.w3.org/1999/xhtml" + xmlns:mml="http://www.w3.org/1998/Math/MathML" + xmlns:db="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>csvWrite</refname> + <refpurpose>CSVファイルを書き込む</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>呼び出し手順</title> + <synopsis> + csvWrite(M, filename) + csvWrite(M, filename, separator) + csvWrite(M, filename, separator, decimal) + csvWrite(M, filename, separator, decimal, precision) + csvWrite(M, filename, separator, decimal, precision, comments) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>引数</title> + <variablelist> + <varlistentry> + <term>filename</term> + <listitem> + <para>1行1列の文字列行列, ファイルのパス.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>M</term> + <listitem> + <para>m行n列の文字列またはdoubleの行列 + (複素数がサポートされています). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>separator</term> + <listitem> + <para>1行1列の文字列の行列, 列セパレータ記号.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>decimal</term> + <listitem> + <para>1行1列の文字列の行列, 小数点記号. + 利用可能な値は"." または ",". + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>precision</term> + <listitem> + <para>1行1列の文字列の行列, C形式.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>comments</term> + <listitem> + <para>m行1列の文字列の行列, + ファイルの先頭に保存されるコメント. + このオプションは,例えば, + ライセンスヘッダをデータファイルに + 記入するために使用できます. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>説明</title> + <para> + この関数は,行列 M を filename にカンマ区切りの値として + 書き込みます. + </para> + <para> + オプションの入力引数のデフォルト値は + <literal>csvDefault</literal> 関数で定義されます. + </para> + <para> + オプションの入力引数に空の行列<literal>[]</literal>を指定すると, + デフォルト値が設定されます. + </para> + <para> + <literal>filename</literal> がすでに存在する場合, + 上書きされます. + </para> + <para> + 関係がある場合 (すなわち,'特殊'文字がある場合),ファイルはUTF-8として保存されます. + </para> + </refsection> + <refsection> + <title>例</title> + <para> + 以下の例では, + <literal>csvWrite</literal> および <literal>csvRead</literal> + 関数を組み合わせて使用します. + </para> + <programlisting role="example"><![CDATA[// CSVファイル形式で行列を保存 +M = [1:10] * 0.1; +filename = fullfile(TMPDIR, "data.csv"); +csvWrite(M, filename); +// テキストとして読み込む +mgetl(filename) +r = csvRead(filename); + ]]></programlisting> + <para> + 以下の例では, + <literal>csvWrite</literal> 関数の種々のオプションを使用します. + </para> + <programlisting role="example"><![CDATA[// CSVファイル形式で行列を保存 +M = rand(2,3); +filename = fullfile(TMPDIR, "data.csv"); +// +// セパレータとしてタブを使用 +csvWrite(M, filename,ascii(9)); +mgetl(filename) +// +// 小数点として "," を使用 +// (そしてセパレータとして空白を使用). +csvWrite(M, filename," ",","); +mgetl(filename) +// +// 精度を指定 +// 注意: このより低い精度により読み書きサイクルで +// 誤差を発生する可能性があります! +csvWrite(M, filename,[],[],"%.8e"); +mgetl(filename) +// +// コメントを指定 +comments = [ +"// Copyright (C) INRIA" +"// This file must be used under the terms of the CeCILL." +]; +csvWrite(M, filename,[],[],[],comments); +mgetl(filename) + ]]></programlisting> + <para>以下の例は + <literal>csvWrite</literal>関数のより高度な使用例を示します. + </para> + <programlisting role="example"><![CDATA[A = [ +1 0 200 %inf 0 +1 1.e-300 200 %inf 0 +9.99999999999990010e-001 9.99999999999999980e-201 200 3.15e300 102 +9.99999999899999990e-001 1.e-100 200 296 117 +1 %inf -%inf %nan 0 +]; +// ファイルに書き込む +filename=fullfile(TMPDIR,"foo.csv"); +csvWrite ( A , filename ); +edit(filename) + ]]></programlisting> + </refsection> + <refsection> + <title>参照</title> + <simplelist type="inline"> + <member> + <link linkend="csvRead">csvRead</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>履歴</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>関数が導入されました. 'csv_readwrite'モジュール + に基づきます. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ja_JP/read_csv.xml b/modules/spreadsheet/help/ja_JP/read_csv.xml new file mode 100755 index 000000000..8f8bafe8b --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/read_csv.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2009 - 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 + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="read_csv" xml:lang="ja"> + <refnamediv> + <refname>read_csv</refname> + <refpurpose> + カンマ区切り形式のファイルを読み込む. + <link linkend="csvRead">csvRead</link>で置換されています. + </refpurpose> + </refnamediv> + <refsection> + <title>説明</title> + <para> + <link linkend="csvRead">csvRead</link>と異なり, + 以前のバージョンとの互換性を維持するために + 変換はデフォルトで<literal>string</literal>に設定されます. + </para> + </refsection> + <refsection> + <title>履歴</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark> + read_csvは,完全に<link linkend="csvRead">csvRead</link>に基づいています. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ja_JP/readxls.xml b/modules/spreadsheet/help/ja_JP/readxls.xml new file mode 100755 index 000000000..1d33a69b0 --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/readxls.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="readxls"> + <refnamediv> + <refname>readxls</refname> + <refpurpose>Excelファイルを読み込む</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>呼び出し手順</title> + <synopsis>sheets = readxls(file_path)</synopsis> + </refsynopsisdiv> + <refsection> + <title>引数</title> + <variablelist> + <varlistentry> + <term>file_path</term> + <listitem> + <para>文字列: Excelファイルのパス. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>sheets</term> + <listitem> + <para> + <literal>xls</literal>型の<literal>mlist</literal>で, + <literal>sheets</literal>という名前のフィールドを有します + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>説明</title> + <para> + Excelファイルのパスを指定すると,この関数は + <literal>sheets</literal>という名前のフィールドを有する<literal>xls</literal> + 型の <literal>mlist</literal>データ構造体を返します. + この<literal>sheets</literal> フィールドはそれ自体 sheetデータ構造体の + リストです. + </para> + <para> + <literal>sheet=mlist(['xlssheet','name','text','value'],sheetname,Text,Value)</literal> ただし, + <literal>sheetname</literal>はシートの名前を有する文字列です. + <literal>Text</literal> はセルの文字列を有する文字列の行列, + <literal>Value</literal>はセルの値を有する数値の行列です. + </para> + <para> + <warning> + BIFF8 Excelファイル(最近のExcelファイルのバージョン(2003))のみが処理可能です. + </warning> + </para> + </refsection> + <refsection> + <title>例</title> + <programlisting role="example"><![CDATA[ +Sheets = readxls('SCI/modules/spreadsheet/demos/xls/t1.xls') +// シートへの基本的な処理 +typeof(Sheets) +s1=Sheets(1) //最初のシートを取得 +typeof(s1) +s1.value //最初のシートのvalueフィールドを取得 +s1.text //最初のシートのtextフィールドを取得 +s1(2,:) //シートの2番目の行を取得 +typeof(s1(2,:)) +disp(s1) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>参照</title> + <simplelist type="inline"> + <member> + <link linkend="xls_open">xls_open</link> + </member> + <member> + <link linkend="xls_read">xls_read</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>使用される関数</title> + <para> + この関数はScilab関数 <literal>xls_open</literal> + および<literal>xls_read</literal>に基づいています. + </para> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ja_JP/write_csv.xml b/modules/spreadsheet/help/ja_JP/write_csv.xml new file mode 100755 index 000000000..a573310dd --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/write_csv.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="write_csv" xml:lang="ja"> + <refnamediv> + <refname>write_csv</refname> + <refpurpose> + カンマ区切り形式でファイルに書き込む. + <link linkend="csvWrite">csvWrite</link>で置換. + </refpurpose> + </refnamediv> + <refsection> + <title>履歴</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark> + <link linkend="csvWrite">csvWrite</link> はwrite_csvのより良い代替品を提供します. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ja_JP/xls_open.xml b/modules/spreadsheet/help/ja_JP/xls_open.xml new file mode 100755 index 000000000..d84b54b6f --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/xls_open.xml @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="xls_open"> + <refnamediv> + <refname>xls_open</refname> + <refpurpose>Excelファイルを読み込み用に開く</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>C呼び出し手順</title> + <synopsis>[fd,SST,Sheetnames,Sheetpos] = xls_open(file_path)</synopsis> + </refsynopsisdiv> + <refsection> + <title>引数</title> + <variablelist> + <varlistentry> + <term>file_path</term> + <listitem> + <para>文字列: Excelファイルのパス + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>fd</term> + <listitem> + <para>数値: Excelストリームの論理ユニット. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>SST</term> + <listitem> + <para>Excelシートに全ての現れる文字列のベクトル. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetnames</term> + <listitem> + <para>文字列ベクトル: シート名. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetpos</term> + <listitem> + <para>数値ベクトル: Excelストリームにおけるシートの開始位置. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>説明</title> + <para>この関数は,指定したファイルが属するExcelストリームを展開するために + まず指定したファイルに関するOLE2データ構造体を解析します. + その後,Excelストリームは<literal>TMDIR</literal>ディレクトリに保存され, + オープンされます. + 続いてこのストリームの最初のシートが読み込まれ, + シート数,シート名,ストリームにおける + シートの位置のようなグローバル情報,および以下のシートで使用される全ての文字列を含む + <literal>SST</literal>が取得されます. + </para> + <para> + <literal>fd</literal> および <literal>Sheetpos</literal> データ + データシートを読み込む際に <link linkend="xls_read">xls_read</link>に指定する必要があります. + </para> + <para> + 1つの関数で1回関数コールをすることにより + Excelファイルを全て読み込む際には<link linkend="readxls">readxls</link>関数を + 使用することができます. + </para> + <para> + <warning> + BIFF8 Excelファイル(最近のExcelファイルのバージョン(2003))のみが処理可能です. + </warning> + </para> + </refsection> + <refsection> + <title>例</title> + <programlisting role="example"><![CDATA[ +//OLEファイルをデコード,展開し,Excelストリームをオープン +[fd,SST,Sheetnames,Sheetpos] = xls_open('SCI/modules/spreadsheet/demos/xls/Test1.xls') +//最初のデータシートを読み込む +[Value,TextInd] = xls_read(fd,Sheetpos(1)) +//スプレッドシートストリームを閉じる +mclose(fd) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>参照</title> + <simplelist type="inline"> + <member> + <link linkend="xls_read">xls_read</link> + </member> + <member> + <link linkend="readxls">readxls</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>参考文献</title> + <para>この関数はMicrosoft ole2 ファイルのドキュメント + (<ulink url="http://chicago.sourceforge.net/devel/docs/ole/">http://chicago.sourceforge.net/devel/docs/ole/</ulink>) および OpenOfficeのExcel + ストリームに関する説明 (<ulink url="http://sc.openoffice.org/spreadsheetfileformat.pdf">http://sc.openoffice.org/spreadsheetfileformat.pdf</ulink>)に基づいています. + </para> + </refsection> + <refsection> + <title>使用される関数</title> + <para> + OLEファイルからスプレッドシートストリームを展開するために + ripole-0.1.4 プロシージャ (<ulink url="http://www.pldaniels.com/ripole">http://www.pldaniels.com/ripole</ulink>) が使用されています. + </para> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ja_JP/xls_read.xml b/modules/spreadsheet/help/ja_JP/xls_read.xml new file mode 100755 index 000000000..82d1dd292 --- /dev/null +++ b/modules/spreadsheet/help/ja_JP/xls_read.xml @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="xls_read"> + <refnamediv> + <refname>xls_read</refname> + <refpurpose>Excelファイルからシートを読み込む</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>呼び出し手順</title> + <synopsis>[Value,TextInd] = xls_read(fd,Sheetpos)</synopsis> + </refsynopsisdiv> + <refsection> + <title>引数</title> + <variablelist> + <varlistentry> + <term>fd</term> + <listitem> + <para> + 数値: <link linkend="xls_open">xls_open</link>により返されたExcelストリームの論理ユニット. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetpos</term> + <listitem> + <para> + 数値: + Excelストリームにおけるシートの開始位置. この位置は + <link linkend="xls_open">xls_open</link>により返された値です. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Value</term> + <listitem> + <para>数値の行列, シートでみつかった数値データ. + 数値データではないセルは値<literal>NaN</literal>で表されます. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>TextInd</term> + <listitem> + <para> + <literal>Value</literal>と同じ大きさのインデックスの行列. + インデックス 0 は,対応するExcelのセルに文字列が存在しないことを示します. + 正のインデックス<literal>i</literal>は + 文字列<literal>SST(i)</literal>を指します. + ただし,<literal>SST</literal>は<link linkend="xls_open">xls_open</link>の出力です. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>説明</title> + <para> + Excelストリームの論理ユニットとこのストリーム内のシートの先頭位置を指定すると, + この関数はExcelシートを読み込みます. + この関数はExcelセルが有する数値データおよび文字列を返します. + </para> + <para> + 1つの関数で1回関数コールをすることにより + Excelファイルを全て読み込む際には<link linkend="readxls">readxls</link>関数を + 使用することができます. + </para> + <para> + <warning> + BIFF8 Excelファイル(最近のExcelファイルのバージョン(2003))のみが処理可能です. + </warning> + </para> + </refsection> + <refsection> + <title>例</title> + <programlisting role="example"><![CDATA[ +//OLEファイルをデコード,展開し,Excelストリームをオープン +[fd,SST,Sheetnames,Sheetpos] = xls_open('SCI/modules/spreadsheet/demos/xls/Test1.xls') +//最初のデータシートを読み込む +[Value,TextInd] = xls_read(fd,Sheetpos(1)) +//スプレッドシートストリームを閉じる +mclose(fd) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>参照</title> + <simplelist type="inline"> + <member> + <link linkend="xls_open">xls_open</link> + </member> + <member> + <link linkend="readxls">readxls</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>参考文献</title> + <para> + この関数は,OpenOfficeのExcelストリームに関する説明 + (<ulink url="http://sc.openoffice.org/spreadsheetfileformat.pdf"> + http://sc.openoffice.org/spreadsheetfileformat.pdf</ulink>)に基づいています. + </para> + </refsection> + <refsection> + <title>使用される関数</title> + <para> + この関数は, Scilabソース版のディレクトリSCIDIR/modules/spreadsheet/src/c + にあるxls.cを使用します. + </para> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/pt_BR/addchapter.sce b/modules/spreadsheet/help/pt_BR/addchapter.sce new file mode 100755 index 000000000..67aeed86f --- /dev/null +++ b/modules/spreadsheet/help/pt_BR/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Planilhas",SCI+"/modules/spreadsheet/help/pt_BR",%T); + diff --git a/modules/spreadsheet/help/pt_BR/readxls.xml b/modules/spreadsheet/help/pt_BR/readxls.xml new file mode 100755 index 000000000..cd2a3c93c --- /dev/null +++ b/modules/spreadsheet/help/pt_BR/readxls.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="readxls" xml:lang="en"> + <refnamediv> + <refname>readxls</refname> + <refpurpose>l um arquivo Excel</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Seqncia de Chamamento</title> + <synopsis>sheets = readxls(file_path)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Parmetros</title> + <variablelist> + <varlistentry> + <term>file_path</term> + <listitem> + <para>string: o endereo do arquivo Excel</para> + </listitem> + </varlistentry> + <varlistentry> + <term>sheets</term> + <listitem> + <para> + um <literal>mlist</literal> de tipo <literal>xls</literal>, + com um campo chamado <literal>sheets</literal> + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Descrio</title> + <para>Dado um endereo de um arquivo Excel, esta funo retorna uma + estrutura de dados <literal>mlist</literal> do tipo + <literal>xls</literal>, com um campo chamado <literal>sheets</literal>. O + campo <literal>sheets</literal> contm uma lista da estutura de dados + folha. + </para> + <para> + <literal>sheet=mlist(['xlssheet','name','text','value'],sheetname,Text,Value)</literal> + onde <literal>sheetname</literal> um string contendo o nome da folha, + <literal>Text</literal> uma matriz de strings que contm os strings e + todas as clulas <literal>Value</literal> uma matriz de nmeros que + contm todos os valores das clulas. + </para> + <para> + <warning> + AVISO: apenas arquivos Excel BIFF8 (ltima verso do Excel (2003)) so + manipulados + </warning> + </para> + </refsection> + <refsection> + <title>Exemplos</title> + <programlisting role="example"><![CDATA[ +Sheets = readxls('SCI/modules/spreadsheet/demos/xls/t1.xls') +// algumas operaes bsicas sobre Sheets +typeof(Sheets) +s1=Sheets(1) //obtendo a primeira folha +typeof(s1) +s1.value //obtendo o campo do valor da primeira folha +s1.text //obtendo o campo do texto da primeira folha +s1(2,:) //obtendo a segunda linha da folha +typeof(s1(2,:)) + +disp(s1) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>Ver Tambm</title> + <simplelist type="inline"> + <member> + <link linkend="xls_open">xls_open</link> + </member> + <member> + <link linkend="xls_read">xls_read</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>Funes Utilizadas</title> + <para> + Esta funo baseada nas funes Scilab <literal>xls_open</literal> + e <literal>xls_read</literal>. + </para> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/pt_BR/xls_open.xml b/modules/spreadsheet/help/pt_BR/xls_open.xml new file mode 100755 index 000000000..da04a55a0 --- /dev/null +++ b/modules/spreadsheet/help/pt_BR/xls_open.xml @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="xls_open" xml:lang="en"> + <refnamediv> + <refname>xls_open</refname> + <refpurpose>abre um arquivo Excel para leitura</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Seqncia de Chamamento</title> + <synopsis>[fd,SST,Sheetnames,Sheetpos] = xls_open(file_path)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Parmetros</title> + <variablelist> + <varlistentry> + <term>file_path</term> + <listitem> + <para>string: o endereo do arquivo Excel.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>fd</term> + <listitem> + <para>nmero, a unidade lgica do fluxo de dados do Excel</para> + </listitem> + </varlistentry> + <varlistentry> + <term>SST</term> + <listitem> + <para>vetor de todos os strings que aparecem na folha do + Excel + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetnames</term> + <listitem> + <para>vetor de strings, os nomes das folhas</para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetpos</term> + <listitem> + <para>vetor de nmeros,as posies dos incios das folhas no fluxo + de dados do Excel + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Descrio</title> + <para>Esta funo primeiro analisa a estrutura de dados ole2 associada ao + dado arquivo para extrair o fluxo de dado do Excel no qual est contido. + Aps isso, o fluxo de dados do Excel salvo no diretrio + <literal>TMDIR</literal> e aberto. Uma unidade lgica + <literal>fd</literal> aponta para este arquivo temporrio. Ento, a + primeira folha neste fluxo lida para se obter informaes globais como o + nmero de folhas, o nome das folhas <literal>Sheetnames</literal>, + endereos das folhas dentro do fluxo <literal>Sheetpos</literal> e + <literal>SST</literal> que contm todos os strings utilizados nas + folhas. + </para> + <para> + Os dados <literal>fd</literal> e <literal>Sheetpos</literal> devem + ser passados para <link linkend="xls_read">xls_read</link> para se ler as + folhas de dados + </para> + <para> + A funo <link linkend="readxls">readxls</link> pode ser usada para + se ler todo um arquivo Excel em uma funo atravs de uma nica chamada de + funo. + </para> + <para> + <warning>AVISO: apenas arquivos Excel BIFF8 (ltima verso do Excel (2003)) + so manipulados. + </warning> + </para> + </refsection> + <refsection> + <title>Exemplos</title> + <programlisting role="example"><![CDATA[ +//Decodificando o arquivo ole, extraindo e abrindo o fluxo de dados do Excel +[fd,SST,Sheetnames,Sheetpos] = xls_open('SCI/modules/spreadsheet/demos/xls/Test1.xls') +//Lendo a primeira folha de dados +[Value,TextInd] = xls_read(fd,Sheetpos(1)) +//fechando o fluxo da planilha +mclose(fd) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>Ver Tambm</title> + <simplelist type="inline"> + <member> + <link linkend="xls_read">xls_read</link> + </member> + <member> + <link linkend="readxls">readxls</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>Bibliografia</title> + <para>Esta funo baseada na documentao do arquivo ole2 da Microsoft + (<ulink url="http://chicago.sourceforge.net/devel/docs/ole/">http://chicago.sourceforge.net/devel/docs/ole/</ulink>) + e na descrio do OpenOffice sobre fluxo de dados do Excel (<ulink url="http://sc.openoffice.org/spreadsheetfileformat.pdf">http://sc.openoffice.org/spreadsheetfileformat.pdf</ulink>). + </para> + </refsection> + <refsection> + <title>Funes Utilizadas</title> + <para> + O procedure ripole-0.1.4 <ulink url="http://www.pldaniels.com/ripole">http://www.pldaniels.com/ripole</ulink>) + utilizado para extrair do arquivo ole o fluxo de dados da planilha. + </para> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/pt_BR/xls_read.xml b/modules/spreadsheet/help/pt_BR/xls_read.xml new file mode 100755 index 000000000..6da9ffe13 --- /dev/null +++ b/modules/spreadsheet/help/pt_BR/xls_read.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="xls_read" xml:lang="en"> + <refnamediv> + <refname>xls_read</refname> + <refpurpose>l uma folha em um arquivo Excel</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Seqncia de Chamamento</title> + <synopsis>[Value,TextInd] = xls_read(fd,Sheetpos)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Parmetros</title> + <variablelist> + <varlistentry> + <term>fd</term> + <listitem> + <para>um nmero, a unidade lgica do fluxo de dados do Excel + retornado por <link linkend="xls_open">xls_open</link>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Sheetpos</term> + <listitem> + <para>um nmero: a posio do incio da folha no fluxo de dados + Excel. Esta posio uma daquelas retornadas por <link linkend="xls_open">xls_open</link>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Value</term> + <listitem> + <para>matriz de nmeros, os dados numricos encontrados na folha. A + clula sem valores numricos representada por valores + <literal>NaN</literal>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>TextInd</term> + <listitem> + <para>uma matriz de ndices com o mesmo tamanho que + <literal>Value</literal>. Os ndices zeros indicam que no existem + strings na celula Excel correspondente. Um ndice positivo + <literal>i </literal> aponta para o string <literal>SST(i)</literal> + onde <literal>SST</literal> dado por <link linkend="xls_open">xls_open</link>. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Descrio</title> + <para>Esta funo l uma folha do Excel, dada uma unidade lgica, em um + fluxo de dados do Excel e a posio do incio da folha neste fluxo de + dados. Ela retorna os dados numricos e os strings contidos nas clulas do + Excel. + </para> + <para> + A funo <link linkend="readxls">readxls</link> pode ser utilizada + para ler todo um arquivo Excel em uma funo utilizando apenas uma chamada + a funo. + </para> + <para> + <warning>AVISO: apenas arquivos Excel BIFF8 (ltima verso do Excel (2003)) so + manipulados. + </warning> + </para> + </refsection> + <refsection> + <title>Exemplos</title> + <programlisting role="example"><![CDATA[ +//decodificando um arquivo ole, extraindo e abrindo um fluxo de dados do Excel +[fd,SST,Sheetnames,Sheetpos] = xls_open('SCI/modules/spreadsheet/demos/xls/Test1.xls') +//lendo a primeira folha de dados +[Value,TextInd] = xls_read(fd,Sheetpos(1)) +//fechando o fluxo de dados da planilha +mclose(fd) + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>Ver Tambm</title> + <simplelist type="inline"> + <member> + <link linkend="xls_open">xls_open</link> + </member> + <member> + <link linkend="readxls">readxls</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>Bibliografia</title> + <para>Esta funo baseada na descrio do OpenOffice sobre fluxo de + dados (<ulink url="http://sc.openoffice.org/spreadsheetfileformat.pdf">http://sc.openoffice.org/spreadsheetfileformat.pdf</ulink>). + </para> + </refsection> + <refsection> + <title>Funes Utilizadas</title> + <para>Esta funo utiliza o arquivo xls.c que pode ser encontrado em uma + verso-fonte do Scilab no diretrio directory + SCIDIR/modules/spreadsheet/src/c. + </para> + </refsection> +</refentry> diff --git a/modules/spreadsheet/help/ru_RU/addchapter.sce b/modules/spreadsheet/help/ru_RU/addchapter.sce new file mode 100755 index 000000000..800958c7a --- /dev/null +++ b/modules/spreadsheet/help/ru_RU/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Электронная таблица",SCI+"/modules/spreadsheet/help/ru_RU",%T); + diff --git a/modules/spreadsheet/help/ru_RU/read_csv.xml b/modules/spreadsheet/help/ru_RU/read_csv.xml new file mode 100755 index 000000000..921e4b61e --- /dev/null +++ b/modules/spreadsheet/help/ru_RU/read_csv.xml @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2009 - 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 + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="read_csv" xml:lang="ru"> + + <refnamediv> + + <refname>read_csv</refname> + + <refpurpose>читает файл, содержащий значения, разделённые запятой (csv)</refpurpose> + + </refnamediv> + + <refsynopsisdiv> + + <title>Последовательность вызова</title> + + <synopsis>M = read_csv(fname [,sep])</synopsis> + + </refsynopsisdiv> + + <refsection> + + <title>Аргументы</title> + + <variablelist> + + <varlistentry> + + <term>fname</term> + + <listitem> + + <para>символьная строка. Имя файла и путь до него.</para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>sep</term> + + <listitem> + + <para> + + символьная строка. Используемый разделитель полей, значение по умолчанию + + ",". + + </para> + + <para> + + Можно использовать <literal>ascii(9)</literal> или <literal>"\t"</literal> для разделителя табуляцией. + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>M</term> + + <listitem> + + <para>матрица строковых значений.</para> + + </listitem> + + </varlistentry> + + </variablelist> + + </refsection> + + <refsection> + + <title>Описание</title> + + <para> + + Для указанного ascii-файла с разделёнными полями, например созданного + + электронной таблицей, используя формат "Текст и запятая", + + <literal>М = read_csv(fname)</literal> возвращает соответствующую Scilab-матрицу + + строк <literal>M</literal>. Для того, чтобы выбрать иной разделитель, используйте + + <literal>M = read_csv(fname,sep)</literal>. + + </para> + + <para> + + <note> + + Вы можете преобразовать часть или все элементы матрицы <literal>M</literal> + + в числовое представление используя функцию <literal>evstr</literal>, + + которая преобразует строковые значения в числовые. + + </note> + + </para> + + </refsection> + + <refsection> + + <title>Примеры</title> + + <programlisting role="example"><![CDATA[ + // создадим файл с какими-то данными, разделёнными табулятором + A = 1:50; + mputl(strcat(string(A),ascii(9)), TMPDIR + '/foo.csv'); + + // прочитаем csv-файл + B = read_csv(TMPDIR + '/foo.csv'); + + // представим в числовой вид значения B + C = evstr(B); + + // сравним исходные данные и результат + and(A == C) + ]]></programlisting> + + </refsection> + + <refsection role="see also"> + + <title>Смотрите также</title> + + <simplelist type="inline"> + + <member> + + <link linkend="write_csv">write_csv</link> + + </member> + + <member> + + <link linkend="evstr">evstr</link> + + </member> + + </simplelist> + + </refsection> + +</refentry> + + + diff --git a/modules/spreadsheet/help/ru_RU/readxls.xml b/modules/spreadsheet/help/ru_RU/readxls.xml new file mode 100755 index 000000000..2816494c6 --- /dev/null +++ b/modules/spreadsheet/help/ru_RU/readxls.xml @@ -0,0 +1,177 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ru" xml:id="readxls"> + + <refnamediv> + + <refname>readxls</refname> + + <refpurpose>читает Excel-файл</refpurpose> + + </refnamediv> + + <refsynopsisdiv> + + <title>Последовательность вызова</title> + + <synopsis>sheets = readxls(file_path)</synopsis> + + </refsynopsisdiv> + + <refsection> + + <title>Аргументы</title> + + <variablelist> + + <varlistentry> + + <term>file_path</term> + + <listitem> + + <para>символьная строка: путь к Excel-файлу. + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>sheets</term> + + <listitem> + + <para> + + матричноориентированный список (<literal>mlist</literal>) типа + + <literal>xls</literal>, с одним полем, названным <literal>sheets</literal> + + </para> + + </listitem> + + </varlistentry> + + </variablelist> + + </refsection> + + <refsection> + + <title>Описание</title> + + <para> + + Для указанного пути к Excel-файлу эта функция возвращает структуру данных + + <literal>mlist</literal> типа <literal>xls</literal>, с одним полем, + + названным <literal>sheets</literal>. Поле <literal>sheets</literal> + + содержит список структур данных листов. + + </para> + + <para> + + <literal>sheet=mlist(['xlssheet','name','text','value'],sheetname,Text,Value)</literal>, где + + <literal>sheetname</literal> -- это символьная строка, содержащая имя листа, + + <literal>Text</literal> -- это матрица строк, которая содержит строки ячеек, а + + <literal>Value</literal> -- это матрица чисел, которая содержит значения ячеек. + + </para> + + <para> + + <warning> + + Обрабатываются только Excel-файлы BIFF8 (Excel-файлы последней версии (2003)). + + </warning> + + </para> + + + + </refsection> + + <refsection> + + <title>Примеры</title> + + <programlisting role="example"><![CDATA[ +Sheets = readxls('SCI/modules/spreadsheet/demos/xls/t1.xls') +// некоторые основные операции с листами Sheets +typeof(Sheets) +s1=Sheets(1) //получим первый лист +typeof(s1) +s1.value //получим поле значения первого листа +s1.text //получим поле текста первого листа +s1(2,:) //получим вторую строку листа +typeof(s1(2,:)) + +disp(s1) + ]]></programlisting> + + </refsection> + + <refsection role="see also"> + + <title>Смотрите также</title> + + <simplelist type="inline"> + + <member> + + <link linkend="xls_open">xls_open</link> + + </member> + + <member> + + <link linkend="xls_read">xls_read</link> + + </member> + + </simplelist> + + </refsection> + + <refsection> + + <title>Используемые функции</title> + + <para> + + Эта функция основана на функциях Scilab'а <literal>xls_open</literal> + + и <literal>xls_read</literal>. + + </para> + + </refsection> + +</refentry> + + + diff --git a/modules/spreadsheet/help/ru_RU/write_csv.xml b/modules/spreadsheet/help/ru_RU/write_csv.xml new file mode 100755 index 000000000..a823b61ed --- /dev/null +++ b/modules/spreadsheet/help/ru_RU/write_csv.xml @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="write_csv" xml:lang="ru"> + + <refnamediv> + + <refname>write_csv</refname> + + <refpurpose> + + записывает файл, содержащий значения, разделённые запятой (csv) + + </refpurpose> + + </refnamediv> + + <refsynopsisdiv> + + <title>Последовательность вызова</title> + + <synopsis>write_csv(M, filename [,sep, dec])</synopsis> + + </refsynopsisdiv> + + <refsection> + + <title>Аргументы</title> + + <variablelist> + + <varlistentry> + + <term>filename</term> + + <listitem> + + <para>символьная строка. Имя файла и путь до него</para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>M</term> + + <listitem> + + <para>матрица строк</para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>sep</term> + + <listitem> + + <para> + + знак разделения столбцов, по умолчанию это табуляция: <literal>ascii(9)</literal> или <literal>"\t"</literal> + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>dec</term> + + <listitem> + + <para> + десятичный знак <literal>'.'</literal> или <literal>','</literal>. По умолчанию: <literal>','</literal> + </para> + + </listitem> + + </varlistentry> + + </variablelist> + + </refsection> + + <refsection> + + <title>Описание</title> + + <para> + + <literal>write_csv(M, filename)</literal> записывает матрицу <literal>M</literal> + + в файл с именем <literal>filename</literal> в виде значений, разделённых табуляцией. + + Входной аргумент <literal>filename</literal> является строкой. + + </para> + + <para> + + Если файл с именем <literal>'filename'</literal> уже существует, то он будет + + переписан. + + </para> + + </refsection> + + <refsection> + + <title>Примеры</title> + + <programlisting role="example"><![CDATA[ + // сохраним матрицу в формате csv-файла + A = [1:10] * 0.1; + write_csv(A, TMPDIR + '/data.tsv'); + + // прочитаем как текст + mgetl(TMPDIR + '/data.tsv') + + //значения, разделённые табуляцией + r = read_csv(TMPDIR + '/data.tsv', ascii(9)); + r = strsubst(r, ',' , '.'); + evstr(r) + + A = [1:10] * 0.1; + write_csv(A', TMPDIR+'/foo.csv', ' ', '.'); + mgetl(TMPDIR+'/foo.csv') + + //значения, разделённые табуляцией + write_csv(A, TMPDIR + '/datas.tsv'); + + //значения, разделённые запятыми + write_csv(A, TMPDIR + '/data.csv', ';'); + + ]]></programlisting> + + </refsection> + + <refsection role="see also"> + + <title>Смотрите также</title> + + <simplelist type="inline"> + + <member> + + <link linkend="read_csv">read_csv</link> + + </member> + + <member> + + <link linkend="evstr">evstr</link> + + </member> + + <member> + + <link linkend="mgetl">mgetl</link> + + </member> + + <member> + + <link linkend="format">format</link> + + </member> + + </simplelist> + + </refsection> + +</refentry> + + + diff --git a/modules/spreadsheet/help/ru_RU/xls_open.xml b/modules/spreadsheet/help/ru_RU/xls_open.xml new file mode 100755 index 000000000..4f3cbfe08 --- /dev/null +++ b/modules/spreadsheet/help/ru_RU/xls_open.xml @@ -0,0 +1,256 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ru" xml:id="xls_open"> + + <refnamediv> + + <refname>xls_open</refname> + + <refpurpose>открывает Excel-файл для чтения</refpurpose> + + </refnamediv> + + <refsynopsisdiv> + + <title>Последовательность вызова</title> + + <synopsis>[fd,SST,Sheetnames,Sheetpos] = xls_open(file_path)</synopsis> + + </refsynopsisdiv> + + <refsection> + + <title>Аргументы</title> + + <variablelist> + + <varlistentry> + + <term>file_path</term> + + <listitem> + + <para> + + символьная строка: путь до Excel-файла. + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>fd</term> + + <listitem> + + <para>число: логический блок на потоке Excel. + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>SST</term> + + <listitem> + + <para> + + вектор всех символьных строк, которые встретились на Excel-листах. + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>Sheetnames</term> + + <listitem> + + <para> + + вектор строк: имена листов. + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>Sheetpos</term> + + <listitem> + + <para> + + вектор чисел: положение начала листов в потоке + + Excel. + + </para> + + </listitem> + + </varlistentry> + + </variablelist> + + </refsection> + + <refsection> + + <title>Описание</title> + + <para> + + Эта функция сначала анализирует структуру данных ole2, связанную с + + указанным файлом, для того, чтобы выделить поток Excel, который + + включён в него. После этого, поток Excel сохраняется в директории + + <literal>TMDIR</literal> и открывается. Логический блок + + <literal>fd</literal> указывает на этот временный файл. Затем читается + + первый лист в этом потоке для того, чтобы получить общую информацию, + + такую, как количество листов, имена листов <literal>Sheetnames</literal>, + + адреса листов в потоке <literal>Sheetpos</literal> и + + <literal>SST</literal>, который содержит все строки, используемые в + + следующих листах. + + </para> + + <para> + + Данные <literal>fd</literal> и <literal>Sheetpos</literal> должны быть переданы + + в <link linkend="xls_read">xls_read</link> для того, чтобы прочитать данные + + листов. + + </para> + + <para> + + Функция <link linkend="readxls">readxls</link> может быть использована для + + чтения всего Excel-файла в одной функции за единственный вызов функции. + + </para> + + <para> + + <warning> + + Обрабатываются только Excel-файлы BIFF8 Excel (последняя версия Excel-файлов (2003)). + + </warning> + + </para> + + </refsection> + + <refsection> + + <title>Примеры</title> + + <programlisting role="example"><![CDATA[ +//Декодируем ole-файл, выделим и откроем поток Excel +[fd,SST,Sheetnames,Sheetpos] = xls_open('SCI/modules/spreadsheet/demos/xls/Test1.xls') + +//Чтение первого листа данных +[Value,TextInd] = xls_read(fd,Sheetpos(1)) + +//закрываем поток электронной таблицы +mclose(fd) + ]]></programlisting> + + </refsection> + + <refsection role="see also"> + + <title>Смотрите также</title> + + <simplelist type="inline"> + + <member> + + <link linkend="xls_read">xls_read</link> + + </member> + + <member> + + <link linkend="readxls">readxls</link> + + </member> + + </simplelist> + + </refsection> + + <refsection> + + <title>Литература</title> + + <para> + + Эта функция основана на документации Microsoft по файлу ole2 + + (<ulink url="http://chicago.sourceforge.net/devel/docs/ole/">http://chicago.sourceforge.net/devel/docs/ole/</ulink>) + + и на описании потока Excel из OpenOffice + + (<ulink url="http://sc.openoffice.org/spreadsheetfileformat.pdf">http://sc.openoffice.org/spreadsheetfileformat.pdf</ulink>). + + </para> + + </refsection> + + <refsection> + + <title>Используемые функции</title> + + <para> + + Для выделения потока электронной таблицы из ole-файла используется + + процедура ripole-0.1.4 (<ulink url="http://www.pldaniels.com/ripole">http://www.pldaniels.com/ripole</ulink>). + + </para> + + </refsection> + +</refentry> + + + diff --git a/modules/spreadsheet/help/ru_RU/xls_read.xml b/modules/spreadsheet/help/ru_RU/xls_read.xml new file mode 100755 index 000000000..aae25142b --- /dev/null +++ b/modules/spreadsheet/help/ru_RU/xls_read.xml @@ -0,0 +1,225 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - INRIA - Pierrick MODE + * Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr> + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ru" xml:id="xls_read"> + + <refnamediv> + + <refname>xls_read</refname> + + <refpurpose>читает листы в Excel-файле</refpurpose> + + </refnamediv> + + <refsynopsisdiv> + + <title>Последовательность вызова</title> + + <synopsis>[Value,TextInd] = xls_read(fd,Sheetpos)</synopsis> + + </refsynopsisdiv> + + <refsection> + + <title>Аргументы</title> + + <variablelist> + + <varlistentry> + + <term>fd</term> + + <listitem> + + <para> + + число: логическая единица на потоке Excel, возвращённая функцией <link linkend="xls_open">xls_open</link> + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>Sheetpos</term> + + <listitem> + + <para> + + число: положение начала листа в потоке Excel. Это положение является одним из тех, + + которые были возвращены функцией <link linkend="xls_open">xls_open</link>. + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>Value</term> + + <listitem> + + <para> + + матрица чисел: числовые данные, найденные в листе. Ячейки без числовых + + данных представляются в виде значения <literal>NaN</literal>. + + </para> + + </listitem> + + </varlistentry> + + <varlistentry> + + <term>TextInd</term> + + <listitem> + + <para> + + матрица индексов того же размера, что и <literal>Value</literal>. Нулевой + + индекс означает, что в соответствующей ячейке Excel нет строковых значений. + + Положительный индекс <literal>i</literal> указывает на строковое значение + + <literal>SST(i)</literal>, где <literal>SST</literal> предоставлено функцией + + <link linkend="xls_open">xls_open</link>. + + </para> + + </listitem> + + </varlistentry> + + </variablelist> + + </refsection> + + <refsection> + + <title>Описание</title> + + <para> + + Эта функция читает листы Excel, указанные логическим блоком в потоке Excel, + + и положение начала листа внутри этого потока. Она возвращает числовые и строковые + + данные, содержащиеся в ячейках Excel. + + </para> + + <para> + + Для чтения всего Excel-файла в одной функции одним-единственным вызовом можно + + использовать Функцию <link linkend="readxls">readxls</link>. + + </para> + + <para> + + <warning> + + Обрабатываются только Excel-файлы BIFF8 Excel (последняя версия Excel-файлов (2003)). + + </warning> + + + </para> + + </refsection> + + <refsection> + + <title>Примеры</title> + + <programlisting role="example"><![CDATA[ +//Декодирование ole-файла, выделение и открытие потока Excel +[fd,SST,Sheetnames,Sheetpos] = xls_open('SCI/modules/spreadsheet/demos/xls/Test1.xls') + +//Чтение перового листа данных +[Value,TextInd] = xls_read(fd,Sheetpos(1)) + +//закрываем поток электронной таблицы +mclose(fd) + ]]></programlisting> + + </refsection> + + <refsection role="see also"> + + <title>Смотрите также</title> + + <simplelist type="inline"> + + <member> + + <link linkend="xls_open">xls_open</link> + + </member> + + <member> + + <link linkend="readxls">readxls</link> + + </member> + + </simplelist> + + </refsection> + + <refsection> + + <title>Литература</title> + + <para> + + Эта функция основана на описании потока Excel из OpenOffice + + (<ulink url="http://sc.openoffice.org/spreadsheetfileformat.pdf">http://sc.openoffice.org/spreadsheetfileformat.pdf</ulink>). + + </para> + + </refsection> + + <refsection> + + <title>Используемые функции</title> + + <para> + + Эта функция ислользует файл xls.c, который можно найти в + + исходном коде Scilab в директории SCIDIR/modules/spreadsheet/src/c. + + </para> + + </refsection> + +</refentry> + + + |