Skip to content

Commit

Permalink
Merge branch 'show'
Browse files Browse the repository at this point in the history
  • Loading branch information
haniibrahim committed May 8, 2022
2 parents 692f21c + d80a6a2 commit 2356ff6
Show file tree
Hide file tree
Showing 20 changed files with 1,679 additions and 663 deletions.
38 changes: 22 additions & 16 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Summary: dataINT provides userfriendly INTERACTIVE reading and writing of csv- a
// 'major.minor.patch', where all fields are numbers.
// If you are just starting your toolbox, you should use '0.1' or '0.1.0'.
// Use '1.0' or '1.0.0' for a tested, good quality first version.
Version: 1.1.1
Version: 1.2.0

// Name(s) of the author(s) of this toolbox.
// They are usually the original copyright holders
Expand Down Expand Up @@ -66,25 +66,25 @@ ScilabVersion: >= 5.5
Depends: >= apifun 0.4.0

// Creation date, e.g. 2019-05-05
Date: 2019-09-03
Date: 2022-05-06

Description: Toolbox for easy and interactive reading and writing of data files

dataINT offers functions for convienient interactice im-/export of data files,
as comma-separated-value- (*.csv, *.dat, *.txt) and binary Excel files (*.xls)
to or from a Scilab matrix.
dataINT offers functions for convenient, interactive im-/export of test-based
data files (*.csv, *.dat, *.txt) to or from a Scilab matrix or from a binary
Excel files (*.xls), respectively.

Parameters, to specify the im-/export, can convieniently entered in a dialog
Parameters, to specify the im-/export, can conveniently entered in a dialog
box and the file selection is done by the platform-specific
file selection dialog.

You can specify the following im-/export parameters:
- Field separator (comma, semicolon, tab, space)
- Decimal separator (comma, point)
- Rows and Colums you want to import (DI_readcsv, DI_readxls only)
- Sheet you want to import (DI_readxls only)
- Number of lines to skip, e.g. header line(s) (DI_readcsv, DI_readxls only)
- Comment header line to describe your data (DI_writecsv only)
- Rows and columns you want to import
- Sheet you want to import
- Number of lines to skip, e.g. header line(s)
- Comment header line to describe your data

IMPORTANT: dataINT does not handle data from XML-based Excel files (.xlsx)!
NOTE: dataINT handles doubles only.
Expand All @@ -95,21 +95,27 @@ Description: Toolbox for easy and interactive reading and writing of data files

FUNCTIONS:

* DI_readcsv
Read comma-separated value files (*.csv, *.dat, *.txt) interactively.
* DI_readxls
Read binary Excel files (*.xls) interactively.
* DI_read
Combines functionality of DI_readcsv and DI_readxls in one function
* DI_writecsv
* DI_show
Read the first 25 or an arbitrary number of lines of a text data file,
displays them in the console and invoke the reading procedure after, if
desired.
* DI_writedat
Write comma-separated value files (*.csv, *.dat, *.txt) interactively.

dataINT is available for Scilab 5.5.x and Scilab 6.0.x and cross-platform.
dataINT is available for Scilab 5.5.x, 6.0.x and 6.1.x. Furthermore
dataINT is cross-platform.

---------------------------------------------------------------------

CHANGELOG:

1.2.0
- DI_show function added
- DI_writedat replaces DI_writecsv
- Deprecation of DI_readcsv and DI_readxls. Successor of both is DI_read

1.1.1
- Fix decimal-comma-bug when reading/parsing space separated text files
with decimal commas
Expand Down
2 changes: 1 addition & 1 deletion demos/dataint.dem.gateway.sce
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function subdemolist = demo_gateway()
demopath = get_absolute_file_path("dataint.dem.gateway.sce");

subdemolist = [
"DI_readcsv and DI_readxls-Demo", "dataint.dem.sce"; ..
"DI_show-Demo", "show.dem.sce"; ..
"DI_read-Demo", "read.dem.sce"; ..
];

Expand Down
2 changes: 1 addition & 1 deletion demos/read.dem.sce
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function read_demo()
disp(dat)

// Plot data
plot(dat(:,1),dat(:,14),".-")
plot(dat(:,1),dat(:,14),"-")
xtitle("Central England Temperature","Year","Mean Temperature [°C]")

//
Expand Down
38 changes: 12 additions & 26 deletions demos/dataint.dem.sce → demos/show.dem.sce
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
// You should have received a copy of the GNU General Public License along with
// this program; if not, see <http://www.gnu.org/licenses/>.

function dataint_demo()
function show_demo()

messagebox("Central England Temperature", "modal","info","Ok");
aw = messagebox("Import from CSV or XLS-file?", "Data source", "question", ["CSV" "XLS"], "modal")
messagebox(["Central England Temperature";"DI_show Demo, preview text-based data and read data"], "modal","info","Ok");

if aw == 1 then // CSV import
[dat,id] = DI_readcsv(fullfile(DI_getpath(), "demos"));
[dat,id] = DI_show(get_absolute_file_path("show.dem.sce"),10); // Show the first 10 lines of the data file
if (id == -1 | id == -2) then // Check for abortion by the user
messagebox("Aborted by user")
disp("Aborted by user");
Expand All @@ -29,36 +27,24 @@ function dataint_demo()
disp("Cannot read file");
abort;
end
else // XLS import
[dat,id] = DI_readxls(fullfile(DI_getpath(), "demos"));
if (id == -1 | id == -2) then
messagebox("Aborted by user")
disp("Aborted by user");
abort;
elseif id < -2 then
messagebox("Cannot read file")
disp("Cannot read file");
abort;
end
end

// Display data
disp(dat)

// Plot data
plot(dat(:,1),dat(:,14),".-")
xtitle("Central England Temperature","Year","Mean Temperature [°C]")
// Display and plot data if available
if dat ~= [] then
disp(dat)
plot(dat(:,1),dat(:,14),"-")
xtitle("Central England Temperature","Year","Mean Temperature [°C]")
end

//
// Load this script into the editor
//
filename = "dataint.dem.sce";
filename = "show.dem.sce";
dname = get_absolute_file_path(filename);
editor ( fullfile(dname,filename) );

endfunction

// Main

dataint_demo();
clear dataint_demo;
show_demo();
clear show_demo;
41 changes: 31 additions & 10 deletions help/en_US/0dataint-overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<refsection>
<title>Introduction and Purpose</title>
<para>
This toolbox provides functions for importing and exporting numeric tabular data (*.csv, *.dat, *.txt, *.xls) without hassle. It is based on Scilab's in-built functions csvRead(), xlsRead(), and cvsWrite(). The purpose of this toolbox is to make the use of these functions more convenient by introducing a GUI for selecting the files and specifying the im- or export parameters.
This toolbox provides functions for importing and exporting numeric tabular data (*.csv, *.dat, *.txt, *.xls) without hassle. It is based on Scilab's in-built functions csvRead(), xlsRead(), fscanfMat() and cvsWrite(). The purpose of this toolbox is to make the use of these functions more convenient by introducing a GUI for selecting the files and specifying the im- or export parameters.
</para>
<para>Choose data file:</para>
<para>
Expand Down Expand Up @@ -72,7 +72,7 @@
<para>
<note>
<para>
dataINT cannot import XML-based Excel files (Excel 2007 and higher)!
dataINT cannot import XML-based Excel files (Excel 2007 and higher) yet! But the toolbox "XLreadwrite" will be called in future versions to offer this feature, too.
</para>
</note>
</para>
Expand All @@ -81,31 +81,52 @@
<title>Functions</title>
<variablelist>
<varlistentry>
<term><link linkend="DI_readcsv">DI_readcsv</link>:</term>
<term><link linkend="DI_read">DI_read</link>:</term>
<listitem>
<para> Read data from a comma-separated-value or another text-based data file and stores it into a matrix variable interactively.</para>
<para>Read data from a comma-separated-value, text-based data file or a binary Excel 95-2003 file and stores it into a matrix variable interactively.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><link linkend="DI_readxls">DI_readxls</link>:</term>
<term><link linkend="DI_show">DI_show</link>:</term>
<listitem>
<para>Read data from a binary Excel 95-2003 file and stores it into a matrix variable interactively.</para>
<para>Read the first 25 or an arbitrary number of lines of a text data file, displays them in the console and invoke the reading procedure "DI_read" after, if desired.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><link linkend="DI_read">DI_read</link>:</term>
<term><link linkend="DI_writedat">DI_writedat</link>:</term>
<listitem>
<para>Combines functionality of DI_readcsv and DI_readxls in one function.</para>
<para>Write a Scilab matrix of doubles to a comma-separated value or other text-based file interactively.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Type "demo_gui()" in Scilab's console and search for "dataINT" to get started.</para>
</refsection>
<refsection>
<title>Functions (deprecated)</title>
<para>The following functions are obsolete. To avoid breaking legal scripts, the code will stay in the toolbox but will be removed from the documentation.</para>
<variablelist>
<varlistentry>
<term><link linkend="DI_writecsv">DI_writecsv</link>:</term>
<term>DI_readcsv:</term>
<listitem>
<para> Read data from a comma-separated-value or another text-based data file and stores it into a matrix variable interactively.</para>
<para>The successor is DI_read.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DI_readxls:</term>
<listitem>
<para>Read data from a binary Excel 95-2003 file and stores it into a matrix variable interactively.</para>
<para>The successor is DI_read.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DI_writecsv:</term>
<listitem>
<para>Write a Scilab matrix of doubles to a comma-separated value or other text-based file interactively.</para>
<para>The successor is DI_writedat.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Type "demo_gui()" in Scilab's console and search for "dataINT" to get started.</para>
</refsection>
<refsection>
<title>Authors</title>
Expand Down
13 changes: 6 additions & 7 deletions help/en_US/DI_read.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<refnamediv>
<refname>DI_read</refname>
<refpurpose>Imports a data file (comma-separated-value, Excel-xls, text-based) in a matrix variable interactively. Combined functionality of DI_readcsv() and DI_readxls().</refpurpose>
<refpurpose>Imports a data file (comma-separated-value, Excel-xls, text-based) in a matrix variable interactively.</refpurpose>
</refnamediv>


Expand Down Expand Up @@ -131,7 +131,7 @@ E.g. to specify a tabulator as separator, type in the word
<varlistentry>
<term>Decimal separator:</term>
<listitem><para>
The character which indentifies the decimal place. In
The character which identifies the decimal place. In
general CSV files it is the point (.), in most European ones it is
the comma (,).
</para></listitem>
Expand Down Expand Up @@ -264,8 +264,8 @@ rows/columns are read to the end.
<programlisting role="example"><![CDATA[
[mat, id] = DI_read(fullfile(DI_getpath(), "demos")); // Read CSV file
disp("Exit-Code: "+string(id),mat,"data:") // Displays imported data "mat" and exit code "id"
if id == 0 then // Plot data if import was sucessful
plot(mat(:,1),mat(:,14),".-")
if id == 0 then // Plot data if import was successful
plot(mat(:,1),mat(:,14),"-")
xtitle("Central England Temperature","Year","Mean Temperature [°C]")
end
Expand All @@ -275,9 +275,8 @@ end
<refsection>
<title>See also</title>
<simplelist type="inline">
<member><link linkend="DI_readxls">DI_readxls</link></member>
<member><link linkend="DI_readcsv">DI_readcsv</link></member>
<member><link linkend="DI_writecsv">DI_writecsv</link></member>
<member><link linkend="DI_show">DI_show</link></member>
<member><link linkend="DI_writedat">DI_writedat</link></member>
<member><link linkend="csvRead">csvRead</link></member>
<member><link linkend="readxls">readxls</link></member>
<member><link linkend="fscanfMat">fscanfMat</link></member>
Expand Down
Loading

0 comments on commit 2356ff6

Please sign in to comment.