data format
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 7168
Common Data Format 3.1
Common Data Format is a self-describing data abstraction for the storage and manipulation of multidimensional data. more>>
Common Data Format is a self-describing data abstraction for the storage and manipulation of multidimensional data in a platform- and discipline-independent fashion.
It consists of a scientific data management package (known as the "CDF Library") that allows programmers and application developers to manage and manipulate scalar, vector, and multi-dimensional data arrays.
Enhancements:
- Adds new sets of APIs to allow Standard Interface to interact with zVariables and other CDF-related information.
- Adds MingW and FreeBSD ports.
- Adds support for Intel C++ and Fortran for Linux.
- Adds the ability to create legacy CDF 2.7 files.
- Fixes a bug that prevented directories from having .cdf or .skt extensions.
<<lessIt consists of a scientific data management package (known as the "CDF Library") that allows programmers and application developers to manage and manipulate scalar, vector, and multi-dimensional data arrays.
Enhancements:
- Adds new sets of APIs to allow Standard Interface to interact with zVariables and other CDF-related information.
- Adds MingW and FreeBSD ports.
- Adds support for Intel C++ and Fortran for Linux.
- Adds the ability to create legacy CDF 2.7 files.
- Fixes a bug that prevented directories from having .cdf or .skt extensions.
Download (1.5MB)
Added: 2006-03-13 License: Public Domain Price:
1320 downloads
Hierarchical Data Format 1.8.0 Beta 3
Hierarchical Data Format is a general purpose library and file format for storing scientific data. more>>
Hierarchical Data Format is a general purpose library and file format for storing scientific data.
HDF5 can store two primary objects: datasets and groups. A dataset is essentially a multidimensional array of data elements, and a group is a structure for organizing objects in an HDF5 file. Using these two basic objects, one can create and store almost any kind of scientific data structure, such as images, arrays of vectors, and structured and unstructured grids. You can also mix and match them in HDF5 files according to your needs.
Efficient storage and I/O.
HDF5 was created to address the data management needs of scientists and engineers working in high performance, data intensive computing environments. As a result, the HDF5 library and format emphasize storage and I/O efficiency. For instance, the HDF5 format can accommodate data in a variety of ways, such as compressed or chunked. And the library is tuned and adapted to read and write data efficiently on parallel computing systems.
Software.
NCSA maintains a suite of free, open source software, including the HDF5 I/O library and several utilities. The HDF5 user community also develops and contributes software, much of it freely available. Unlike HDF4, there is little commercial support for HDF5 at this time, but we are successfully working with vendors to change this.
Emphasis on standards.
Data can be stored in HDF5 in an endless variety of ways, so it is important for communities of users to standardize on how their data is to be organized in HDF5. This makes it possible to share data easily, and also to build and share tools for accessing and analyzing data stored in HDF5. The NCSA HDF team works with users to encourage them to organize HDF5 files in standard ways.
Large and varied user community.
HDF5 users range across a variety of engineering and scientific fields, and even some non-technical fields. Data stored in HDF5 is used for a wide range of applications, from computational fluid dynamics to film making.
Main features:
- Parallel HDF5 - Information on installing and using Parallel HDF5
- SZIP Compression - Information about SZIP Compression in HDF5
- Thread Safe HDF5 - Information on thread-safe capabilities of HDF5 and how to install
- The High Level HDF5 APIs, previously distributed separately, are now distributed as part of the main HDF5 Library:
- High Level HDF5 APIs - Information on installing and using the High Level HDF5 APIs
Applications:
- HDF Java Products - HDF4/HDF5 Java interfaces and viewer, HDFView.
- HDF Web-browser Plug-in - The HDF Web-browser plug-in is a windowed browser plug-in that is launched from a web browser to display HDF4 and HDF5 files.
- netCDF-4 - The NCSA and NetCDF groups are collaborating on a version of NetCDF built on top of HDF5.
- HDF5 XML Information Page - DTD and tools for using HDF5 with XML
- HDF5 WRF I/O Module - I/O module that reads HDF5 datasets for the Weather Research and Forecasting Model
- HDF5 Mesh API (prototype) - API for storing and retrieving structured and unstructured mesh data
Enhancements:
- The default Fortran was switched to G95 when using GCC.
- The autoconf build tools were updated. Fortran interfaces were added for the Image, Table, and Lite APIs.
- A Dimension Scale API (H5DS) was added.
- FreeBSD is now supported on AMD64 with GNU C and Fortran compilers.
- Support for sequential and parallel libraries was added for Intel 64 Linux clusters.
- Several bugs with writing fill values for datasets that have a variable-length datatype or component datatype were fixed.
<<lessHDF5 can store two primary objects: datasets and groups. A dataset is essentially a multidimensional array of data elements, and a group is a structure for organizing objects in an HDF5 file. Using these two basic objects, one can create and store almost any kind of scientific data structure, such as images, arrays of vectors, and structured and unstructured grids. You can also mix and match them in HDF5 files according to your needs.
Efficient storage and I/O.
HDF5 was created to address the data management needs of scientists and engineers working in high performance, data intensive computing environments. As a result, the HDF5 library and format emphasize storage and I/O efficiency. For instance, the HDF5 format can accommodate data in a variety of ways, such as compressed or chunked. And the library is tuned and adapted to read and write data efficiently on parallel computing systems.
Software.
NCSA maintains a suite of free, open source software, including the HDF5 I/O library and several utilities. The HDF5 user community also develops and contributes software, much of it freely available. Unlike HDF4, there is little commercial support for HDF5 at this time, but we are successfully working with vendors to change this.
Emphasis on standards.
Data can be stored in HDF5 in an endless variety of ways, so it is important for communities of users to standardize on how their data is to be organized in HDF5. This makes it possible to share data easily, and also to build and share tools for accessing and analyzing data stored in HDF5. The NCSA HDF team works with users to encourage them to organize HDF5 files in standard ways.
Large and varied user community.
HDF5 users range across a variety of engineering and scientific fields, and even some non-technical fields. Data stored in HDF5 is used for a wide range of applications, from computational fluid dynamics to film making.
Main features:
- Parallel HDF5 - Information on installing and using Parallel HDF5
- SZIP Compression - Information about SZIP Compression in HDF5
- Thread Safe HDF5 - Information on thread-safe capabilities of HDF5 and how to install
- The High Level HDF5 APIs, previously distributed separately, are now distributed as part of the main HDF5 Library:
- High Level HDF5 APIs - Information on installing and using the High Level HDF5 APIs
Applications:
- HDF Java Products - HDF4/HDF5 Java interfaces and viewer, HDFView.
- HDF Web-browser Plug-in - The HDF Web-browser plug-in is a windowed browser plug-in that is launched from a web browser to display HDF4 and HDF5 files.
- netCDF-4 - The NCSA and NetCDF groups are collaborating on a version of NetCDF built on top of HDF5.
- HDF5 XML Information Page - DTD and tools for using HDF5 with XML
- HDF5 WRF I/O Module - I/O module that reads HDF5 datasets for the Weather Research and Forecasting Model
- HDF5 Mesh API (prototype) - API for storing and retrieving structured and unstructured mesh data
Enhancements:
- The default Fortran was switched to G95 when using GCC.
- The autoconf build tools were updated. Fortran interfaces were added for the Image, Table, and Lite APIs.
- A Dimension Scale API (H5DS) was added.
- FreeBSD is now supported on AMD64 with GNU C and Fortran compilers.
- Support for sequential and parallel libraries was added for Intel 64 Linux clusters.
- Several bugs with writing fill values for datasets that have a variable-length datatype or component datatype were fixed.
Download (4.9MB)
Added: 2007-08-02 License: BSD License Price:
816 downloads
AnyData::Format::XML 0.10
AnyData::Format::XML is a Perl module for tiedhash and DBI access to XML. more>>
AnyData::Format::XML is a Perl module for tiedhash and DBI access to XML.
SYNOPSIS
# access XML data via a multi-dimensional tied hash
# see AnyData.pod for full details
#
use AnyData;
my $table = adTie( XML, $file, $mode, $flags );
OR
# convert data to and from XML
# see AnyData.pod for full details
#
use AnyData;
adConvert( XML, $file1, $any_other_format, $file2, $flags );
adConvert( $any_other_format, $file1, XML, $file2, $flags );
OR
# access the data via DBI and SQL
# see DBD::AnyData.pod for full details
#
use DBI;
my $dbh = DBI->connect( dbi:AnyData );
$dbh->func(mytable,XML,$file,$flags,ad_catalog);
See below for a description of the optional flags that apply to all of these examples.
This module allows you to create, search, modify and/or convert XML data and files by treating them as databases without having to actually create separate database files. The data can be accessed via a multi-dimensional tiedhash using AnyData.pm or via DBI and SQL commands using DBD::AnyData.pm. See those modules for complete details of usage.
The module is built on top of Michel Rodriguezs excellent XML::Twig which means that the AnyData interfaces can now include information from DTDs, be smarter about inferring data structure, reduce memory consumption on huge files, and provide access to many powerful features of XML::Twig and XML::Parser on which it is based.
Importing options allow you to import/access/modify XML of almost any length or complexity. This includes the ability to access different subtrees as separate or joined databases.
Exporting and converting options allow you to take data from almost any source (a perl array, any DBI database, etc.) and output it as an XML file. You can control the formating of the resulting XML either by supplying a DTD listing things like nesting of tags and which columns should be output as attributes and/or you can use XML::Twig pretty_print settings to generate half a dozen different levels of compactness or whitespace in how the XML looks.
The documentaion below outlines the special flags that can be used in either of the interfaces to fine-tune how the XML is treated.
The flags listed below define the relationship between tags and attributes in the XML document and columns in the resulting database. In many cases, you can simply accept the defaults and the database will be built automatically. However, you can also fine tune the generation of the database by specifying which tags and attributes you are interested in and their relationship with database columns.
<<lessSYNOPSIS
# access XML data via a multi-dimensional tied hash
# see AnyData.pod for full details
#
use AnyData;
my $table = adTie( XML, $file, $mode, $flags );
OR
# convert data to and from XML
# see AnyData.pod for full details
#
use AnyData;
adConvert( XML, $file1, $any_other_format, $file2, $flags );
adConvert( $any_other_format, $file1, XML, $file2, $flags );
OR
# access the data via DBI and SQL
# see DBD::AnyData.pod for full details
#
use DBI;
my $dbh = DBI->connect( dbi:AnyData );
$dbh->func(mytable,XML,$file,$flags,ad_catalog);
See below for a description of the optional flags that apply to all of these examples.
This module allows you to create, search, modify and/or convert XML data and files by treating them as databases without having to actually create separate database files. The data can be accessed via a multi-dimensional tiedhash using AnyData.pm or via DBI and SQL commands using DBD::AnyData.pm. See those modules for complete details of usage.
The module is built on top of Michel Rodriguezs excellent XML::Twig which means that the AnyData interfaces can now include information from DTDs, be smarter about inferring data structure, reduce memory consumption on huge files, and provide access to many powerful features of XML::Twig and XML::Parser on which it is based.
Importing options allow you to import/access/modify XML of almost any length or complexity. This includes the ability to access different subtrees as separate or joined databases.
Exporting and converting options allow you to take data from almost any source (a perl array, any DBI database, etc.) and output it as an XML file. You can control the formating of the resulting XML either by supplying a DTD listing things like nesting of tags and which columns should be output as attributes and/or you can use XML::Twig pretty_print settings to generate half a dozen different levels of compactness or whitespace in how the XML looks.
The documentaion below outlines the special flags that can be used in either of the interfaces to fine-tune how the XML is treated.
The flags listed below define the relationship between tags and attributes in the XML document and columns in the resulting database. In many cases, you can simply accept the defaults and the database will be built automatically. However, you can also fine tune the generation of the database by specifying which tags and attributes you are interested in and their relationship with database columns.
Download (0.043MB)
Added: 2006-09-13 License: Perl Artistic License Price:
1137 downloads
Fortran::Format 0.90
Fortran::Format is a Perl module to read and write data according to a standard Fortran 77 FORMAT. more>>
Fortran::Format is a Perl module to read and write data according to a standard Fortran 77 FORMAT.
SYNOPSYS
use Fortran::Format;
my $f = Fortran::Format->new("2(N: ,I4,2X)");
print $f->write(1 .. 10);
# prints the following:
# N: 1 N: 2
# N: 3 N: 4
# N: 5 N: 6
# N: 7 N: 8
# N: 9 N: 10
# if you dont want to save the format object,
# just chain the calls:
Fortran::Format->new("2(N: ,I4,2X)")->write(1 .. 10);
This is a Perl implementation of the Fortran 77 formatted input/output facility. One possible use is for producing input files for old Fortran programs, making sure that their column-oriented records are rigorously correct. Fortran formats may also have some advantages over printf in some cases: it is very easy to output an array, reusing the format as needed; and the syntax for repeated columns is more concise. Unlike printf, for good or ill, Fortran-formatted fields never exceed their desired width. For example, compare
printf "%3d", 12345; # prints "12345"
print Fortran::Format->new("I3")->write(12345); # prints "***"
This implementation was written in pure Perl, with portability and correctness in mind. It implements the full ANSI standard for Fortran 77 Formats (or at least it should). It was not written with speed in mind, so if you need to process millions of records it may not be what you need.
<<lessSYNOPSYS
use Fortran::Format;
my $f = Fortran::Format->new("2(N: ,I4,2X)");
print $f->write(1 .. 10);
# prints the following:
# N: 1 N: 2
# N: 3 N: 4
# N: 5 N: 6
# N: 7 N: 8
# N: 9 N: 10
# if you dont want to save the format object,
# just chain the calls:
Fortran::Format->new("2(N: ,I4,2X)")->write(1 .. 10);
This is a Perl implementation of the Fortran 77 formatted input/output facility. One possible use is for producing input files for old Fortran programs, making sure that their column-oriented records are rigorously correct. Fortran formats may also have some advantages over printf in some cases: it is very easy to output an array, reusing the format as needed; and the syntax for repeated columns is more concise. Unlike printf, for good or ill, Fortran-formatted fields never exceed their desired width. For example, compare
printf "%3d", 12345; # prints "12345"
print Fortran::Format->new("I3")->write(12345); # prints "***"
This implementation was written in pure Perl, with portability and correctness in mind. It implements the full ANSI standard for Fortran 77 Formats (or at least it should). It was not written with speed in mind, so if you need to process millions of records it may not be what you need.
Download (0.018MB)
Added: 2007-04-20 License: Perl Artistic License Price:
925 downloads
DateTime::Format::Pg 0.15
DateTime::Format::Pg is a Perl module to parse and format PostgreSQL dates and times. more>>
DateTime::Format::Pg is a Perl module to parse and format PostgreSQL dates and times.
SYNOPSIS
use DateTime::Format::Pg;
my $dt = DateTime::Format::Pg->parse_datetime( 2003-01-16 23:12:01 );
# 2003-01-16T23:12:01+0200
DateTime::Format::Pg->format_datetime($dt);
This module understands the formats used by PostgreSQL for its DATE, TIME, TIMESTAMP, and INTERVAL data types. It can be used to parse these formats in order to create DateTime or DateTime::Duration objects, and it can take a DateTime or DateTime::Duration object and produce a string representing it in a format accepted by PostgreSQL.
CONSTRUCTORS
The following methods can be used to create DateTime::Format::Pg objects.
new( name => value, ... )
Creates a new DateTime::Format::Pg instance. This is generally not required for simple operations. If you wish to use a different parsing style from the default then it is more comfortable to create an object.
my $parser = DateTime::Format::Pg->new()
my $copy = $parser->new( european => 1 );
This method accepts the following options:
european
If european is set to non-zero, dates are assumed to be in european dd/mm/yyyy format. The default is to assume US mm/dd/yyyy format (because this is the default for PostgreSQL).
This option only has an effect if PostgreSQL is set to output dates in the PostgreSQL (DATE only) and SQL (DATE and TIMESTAMP) styles.
Note that you dont have to set this option if the PostgreSQL server has been set to use the ISO format, which is the default.
server_tz
This option can be set to a DateTime::TimeZone object or a string that contains a time zone name.
This value must be set to the same value as the PostgreSQL servers time zone in order to parse TIMESTAMP WITH TIMEZONE values in the PostgreSQL, SQL, and German formats correctly.
Note that you dont have to set this option if the PostgreSQL server has been set to use the ISO format, which is the default.
clone()
This method is provided for those who prefer to explicitly clone via a method called clone().
my $clone = $original->clone();
If called as a class method it will die.
<<lessSYNOPSIS
use DateTime::Format::Pg;
my $dt = DateTime::Format::Pg->parse_datetime( 2003-01-16 23:12:01 );
# 2003-01-16T23:12:01+0200
DateTime::Format::Pg->format_datetime($dt);
This module understands the formats used by PostgreSQL for its DATE, TIME, TIMESTAMP, and INTERVAL data types. It can be used to parse these formats in order to create DateTime or DateTime::Duration objects, and it can take a DateTime or DateTime::Duration object and produce a string representing it in a format accepted by PostgreSQL.
CONSTRUCTORS
The following methods can be used to create DateTime::Format::Pg objects.
new( name => value, ... )
Creates a new DateTime::Format::Pg instance. This is generally not required for simple operations. If you wish to use a different parsing style from the default then it is more comfortable to create an object.
my $parser = DateTime::Format::Pg->new()
my $copy = $parser->new( european => 1 );
This method accepts the following options:
european
If european is set to non-zero, dates are assumed to be in european dd/mm/yyyy format. The default is to assume US mm/dd/yyyy format (because this is the default for PostgreSQL).
This option only has an effect if PostgreSQL is set to output dates in the PostgreSQL (DATE only) and SQL (DATE and TIMESTAMP) styles.
Note that you dont have to set this option if the PostgreSQL server has been set to use the ISO format, which is the default.
server_tz
This option can be set to a DateTime::TimeZone object or a string that contains a time zone name.
This value must be set to the same value as the PostgreSQL servers time zone in order to parse TIMESTAMP WITH TIMEZONE values in the PostgreSQL, SQL, and German formats correctly.
Note that you dont have to set this option if the PostgreSQL server has been set to use the ISO format, which is the default.
clone()
This method is provided for those who prefer to explicitly clone via a method called clone().
my $clone = $original->clone();
If called as a class method it will die.
Download (0.019MB)
Added: 2007-05-17 License: Perl Artistic License Price:
890 downloads
Tie::Formatted 0.02
Tie::Formatted is a Perl module embed sprintf() formatting in regular print(). more>>
Tie::Formatted is a Perl module embed sprintf() formatting in regular print().
SYNOPSIS
use Tie::Formatted;
print "The value is $format{$number, "%3d"} ",
"(or $format{$number, "%04x"} in hex)n";
print "some numbers: $format{ 12, 492, 1, 8753, "%04d"}n";
This module creates a global read-only hash, %format, for formatting data items with standard sprintf format specifications. Since its a hash, you can interpolate it into strings as well as use it standalone.
The hash should be "accessed" with two or more "keys". The last key is interpreted as a sprintf format for each data item specified in the preceeding arguments. This allows you to format multiple items at once using the same format for each.
Alternate name
If you prefer, you can specify a different name for the magical formatting hash by supplying it as as argument when useing the module:
use Tie::Formatted qw(z);
This makes %z the magic hash instead.
print "This is hex: $z{255, "%04x"}n";
Tie::Formatted currently supports only one format in the final argument; this may change if there is demand for it.
<<lessSYNOPSIS
use Tie::Formatted;
print "The value is $format{$number, "%3d"} ",
"(or $format{$number, "%04x"} in hex)n";
print "some numbers: $format{ 12, 492, 1, 8753, "%04d"}n";
This module creates a global read-only hash, %format, for formatting data items with standard sprintf format specifications. Since its a hash, you can interpolate it into strings as well as use it standalone.
The hash should be "accessed" with two or more "keys". The last key is interpreted as a sprintf format for each data item specified in the preceeding arguments. This allows you to format multiple items at once using the same format for each.
Alternate name
If you prefer, you can specify a different name for the magical formatting hash by supplying it as as argument when useing the module:
use Tie::Formatted qw(z);
This makes %z the magic hash instead.
print "This is hex: $z{255, "%04x"}n";
Tie::Formatted currently supports only one format in the final argument; this may change if there is demand for it.
Download (0.005MB)
Added: 2007-01-15 License: Perl Artistic License Price:
1012 downloads
DBIx::SQLCrosstab::Format 1.17
DBIx::SQLCrosstab::Format is a Perl module with formats results created by DBIx::SQLCrosstab. more>>
DBIx::SQLCrosstab::Format is a Perl module with formats results created by DBIx::SQLCrosstab.
SYNOPSIS
use DBIx::SQLCrosstab::Format;
my $dbh=DBI->connect("dbi:driver:database"
"user","password", {RaiseError=>1})
or die "error in connection $DBI::errstrn";
my $params = {
dbh => $dbh,
op => [ [ SUM, salary] ],
from => person INNER JOIN departments USING (dept_id),
rows => [
{ col => country},
],
cols => [
{
id => dept,
value =>department,
from =>departments
},
{
id => gender, from => person
}
]
};
my $xtab = DBIx::SQLCrosstab::Format->new($params)
or die "error in creation ($DBIx::SQLCrosstab::errstr)n";
my $query = $xtab->get_query("#")
or die "error in query building $DBIx::SQLCrosstab::errstrn";
if ( $xtab->get_recs) {
# do something with records, or use a built-in function
# to produce a well formatted HTML table
#
print $xtab->as_html;
print $xtab->as_xml;
print $xtab->as_yaml;
print $xtab->as_csv(header);
$xtab->as_xls("xtab.xls");
use Data::Dumper;
print Data::Dumper->Dump ([ $xtab->as_perl_struct(hoh)],
[hoh]);
print Data::Dumper->Dump ([ $xtab->as_perl_struct(losh)],
[losh]);
print Data::Dumper->Dump ([ $xtab->as_perl_struct(loh)],
[loh]);
}
else {
die "error in execution $DBIx::SQLCrosstab::errstrn";
}
DBIx::SQLCrosstab::Format is a class descending from DBIx::SQLCrosstab. Being a child class, it inherits its parent methods and can be used in the same way.
In addition, it provides methods to produce formatted output.
<<lessSYNOPSIS
use DBIx::SQLCrosstab::Format;
my $dbh=DBI->connect("dbi:driver:database"
"user","password", {RaiseError=>1})
or die "error in connection $DBI::errstrn";
my $params = {
dbh => $dbh,
op => [ [ SUM, salary] ],
from => person INNER JOIN departments USING (dept_id),
rows => [
{ col => country},
],
cols => [
{
id => dept,
value =>department,
from =>departments
},
{
id => gender, from => person
}
]
};
my $xtab = DBIx::SQLCrosstab::Format->new($params)
or die "error in creation ($DBIx::SQLCrosstab::errstr)n";
my $query = $xtab->get_query("#")
or die "error in query building $DBIx::SQLCrosstab::errstrn";
if ( $xtab->get_recs) {
# do something with records, or use a built-in function
# to produce a well formatted HTML table
#
print $xtab->as_html;
print $xtab->as_xml;
print $xtab->as_yaml;
print $xtab->as_csv(header);
$xtab->as_xls("xtab.xls");
use Data::Dumper;
print Data::Dumper->Dump ([ $xtab->as_perl_struct(hoh)],
[hoh]);
print Data::Dumper->Dump ([ $xtab->as_perl_struct(losh)],
[losh]);
print Data::Dumper->Dump ([ $xtab->as_perl_struct(loh)],
[loh]);
}
else {
die "error in execution $DBIx::SQLCrosstab::errstrn";
}
DBIx::SQLCrosstab::Format is a class descending from DBIx::SQLCrosstab. Being a child class, it inherits its parent methods and can be used in the same way.
In addition, it provides methods to produce formatted output.
Download (0.065MB)
Added: 2006-09-27 License: Perl Artistic License Price:
1122 downloads
AnyData 0.10
AnyData is a Perl module that allows easy access to data in many formats. more>>
AnyData is a Perl module that allows easy access to data in many formats.
SYNOPSIS
$table = adTie( CSV,my_db.csv,o, # create a table
{col_names=>name,country,sex}
);
$table->{Sue} = {country=>de,sex=>f}; # insert a row
delete $table->{Tom}; # delete a single row
$str = $table->{Sue}->{country}; # select a single value
while ( my $row = each %$table ) { # loop through table
print $row->{name} if $row->{sex} eq f;
}
$rows = $table->{{age=>> 25}} # select multiple rows
delete $table->{{country=>qr/us|mx|ca/}}; # delete multiple rows
$table->{{country=>Nz}}={country=>nz}; # update multiple rows
my $num = adRows( $table, age=>< 25 ); # count matching rows
my @names = adNames( $table ); # get column names
my @cars = adColumn( $table, cars ); # group a column
my @formats = adFormats(); # list available parsers
adExport( $table, $format, $file, $flags ); # save in specified format
print adExport( $table, $format, $flags ); # print to screen in format
print adDump($table); # dump table to screen
undef $table; # close the table
adConvert( $format1, $file1, $format2, $file2 ); # convert btwn formats
print adConvert( $format1, $file1, $format2 ); # convert to screen
The rather wacky idea behind this module and its sister module DBD::AnyData is that any data, regardless of source or format should be accessable and modifiable with the same simple set of methods. This module provides a multi-dimensional tied hash interface to data in a dozen different formats. The DBD::AnyData module adds a DBI/SQL interface for those same formats.
Both modules provide built-in protections including appropriate flocking() for all I/O and (in most cases) record-at-a-time access to files rather than slurping of entire files.
Currently supported formats include general format flatfiles (CSV, Fixed Length, etc.), specific formats (passwd files, httpd logs, etc.), and a variety of other kinds of formats (XML, Mp3, HTML tables). The number of supported formats will continue to grow rapidly since there is an open API making it easy for any author to create additional format parsers which can be plugged in to AnyData itself and thereby be accessible by either the tiedhash or DBI/SQL interface.
The AnyData.pm module itself is pure Perl and does not depend on anything other than modules that come standard with Perl. Some formats and some advanced features require additional modules: to use the remote ftp/http features, you must have the LWP bundle installed; to use the XML format, you must have XML::Parser and XML::Twig installed; to use the HTMLtable format for reading, you must have HTML::Parser and HTML::TableExtract installed but you can use the HTMLtable for writing with just the standard CGI module. To use DBI/SQL commands, you must have DBI, DBD::AnyData, SQL::Statement and DBD::File installed.
<<lessSYNOPSIS
$table = adTie( CSV,my_db.csv,o, # create a table
{col_names=>name,country,sex}
);
$table->{Sue} = {country=>de,sex=>f}; # insert a row
delete $table->{Tom}; # delete a single row
$str = $table->{Sue}->{country}; # select a single value
while ( my $row = each %$table ) { # loop through table
print $row->{name} if $row->{sex} eq f;
}
$rows = $table->{{age=>> 25}} # select multiple rows
delete $table->{{country=>qr/us|mx|ca/}}; # delete multiple rows
$table->{{country=>Nz}}={country=>nz}; # update multiple rows
my $num = adRows( $table, age=>< 25 ); # count matching rows
my @names = adNames( $table ); # get column names
my @cars = adColumn( $table, cars ); # group a column
my @formats = adFormats(); # list available parsers
adExport( $table, $format, $file, $flags ); # save in specified format
print adExport( $table, $format, $flags ); # print to screen in format
print adDump($table); # dump table to screen
undef $table; # close the table
adConvert( $format1, $file1, $format2, $file2 ); # convert btwn formats
print adConvert( $format1, $file1, $format2 ); # convert to screen
The rather wacky idea behind this module and its sister module DBD::AnyData is that any data, regardless of source or format should be accessable and modifiable with the same simple set of methods. This module provides a multi-dimensional tied hash interface to data in a dozen different formats. The DBD::AnyData module adds a DBI/SQL interface for those same formats.
Both modules provide built-in protections including appropriate flocking() for all I/O and (in most cases) record-at-a-time access to files rather than slurping of entire files.
Currently supported formats include general format flatfiles (CSV, Fixed Length, etc.), specific formats (passwd files, httpd logs, etc.), and a variety of other kinds of formats (XML, Mp3, HTML tables). The number of supported formats will continue to grow rapidly since there is an open API making it easy for any author to create additional format parsers which can be plugged in to AnyData itself and thereby be accessible by either the tiedhash or DBI/SQL interface.
The AnyData.pm module itself is pure Perl and does not depend on anything other than modules that come standard with Perl. Some formats and some advanced features require additional modules: to use the remote ftp/http features, you must have the LWP bundle installed; to use the XML format, you must have XML::Parser and XML::Twig installed; to use the HTMLtable format for reading, you must have HTML::Parser and HTML::TableExtract installed but you can use the HTMLtable for writing with just the standard CGI module. To use DBI/SQL commands, you must have DBI, DBD::AnyData, SQL::Statement and DBD::File installed.
Download (0.043MB)
Added: 2007-05-10 License: Perl Artistic License Price:
902 downloads
Data::Faker::DateTime 0.07
Data::Faker::DateTime is a Data::Faker plugin. more>>
Data::Faker::DateTime is a Data::Faker plugin.
DATA PROVIDERS
unixtime
Return a unix time (seconds since the epoch) for a random time between the epoch and now.
date
Return a random date as a string, using a random date format (see date_format).
time
Return a random time as a string, using a random time format (see time_format).
rfc822
Return an RFC 822 formatted random date. This method may not work on systems using a non-GNU strftime implementation (kindly let me know if that is the case.)
ampm
Returns am or pm randomly (in the current locale) using one of the formats specified in ampm_format.
time_format
Return a random time format.
date_format
Return a random date format.
ampm_format
Return a random am/pm format.
datetime_format
Return a random date and time format.
month
Return a random month name, unabbreviated, in the current locale.
month_abbr
Return a random month name, abbreviated, in the current locale.
weekday
Return a random weekday name, unabbreviated, in the current locale.
weekday_abbr
Return a random weekday name, abbreviated, in the current locale.
sqldate
Return a random date in the ISO8601 format commonly used by SQL servers (YYYY-MM-DD).
datetime_locale
Return a datetime string in the preferred date representation for the current locale, for a random date.
date_locale
Return a date string in the preferred date representation for the current locale, for a random date.
time_locale
Return a time string in the preferred date representation for the current locale, for a random date.
century
Return a random century number.
dayofmonth
Return a random day of the month.
<<lessDATA PROVIDERS
unixtime
Return a unix time (seconds since the epoch) for a random time between the epoch and now.
date
Return a random date as a string, using a random date format (see date_format).
time
Return a random time as a string, using a random time format (see time_format).
rfc822
Return an RFC 822 formatted random date. This method may not work on systems using a non-GNU strftime implementation (kindly let me know if that is the case.)
ampm
Returns am or pm randomly (in the current locale) using one of the formats specified in ampm_format.
time_format
Return a random time format.
date_format
Return a random date format.
ampm_format
Return a random am/pm format.
datetime_format
Return a random date and time format.
month
Return a random month name, unabbreviated, in the current locale.
month_abbr
Return a random month name, abbreviated, in the current locale.
weekday
Return a random weekday name, unabbreviated, in the current locale.
weekday_abbr
Return a random weekday name, abbreviated, in the current locale.
sqldate
Return a random date in the ISO8601 format commonly used by SQL servers (YYYY-MM-DD).
datetime_locale
Return a datetime string in the preferred date representation for the current locale, for a random date.
date_locale
Return a date string in the preferred date representation for the current locale, for a random date.
time_locale
Return a time string in the preferred date representation for the current locale, for a random date.
century
Return a random century number.
dayofmonth
Return a random day of the month.
Download (0.020MB)
Added: 2006-10-25 License: Perl Artistic License Price:
1096 downloads
IFF Format Library 0.1
IFF Format Library provides header structures and utility functions for reading and writing data files in the Interchange Files. more>>
IFF Format Library provides header structures and utility functions for reading and writing data files in the Interchange Files.
The Interchange File Format is a simple structured binary file format consisting of sized and typed chunks of data, selectively readable without having to know the format of each chunk.
This functionality is similar to what XML provides for text documents, and the IFF format can indeed be viewed as a sort of a binary XML. IFFs extensibility is an excellent way of not breaking old applications when the file format changes, making it an excellent choice for your next applications data files.
The IFF is also the simplest and the smallest such data format, ensuring that your files consist of real data rather than overhead and that your code spends more time on real work than on parsing the data file. This library defines the IFF header structures and provides simple algorithms for directly writing many of your objects as chunks and containers.
Installation:
This library can be downloaded from SourceForge, as can its sole prerequisite:
libiff - The library source package.
uSTL - An STL implementation, required.
First, unpack and install uSTL, as described in its documentation. Unpack libiff and run ./configure; make install, which will install the library to /usr/local/lib and headers to /usr/local/include. ./configure --help lists available configuration options, in the usual autoconf fashion. The one thing to be aware of is that by default the library will not be completely conforming to EA85 specification. Why that is so, and why you should take the default options anyway, is discussed in detail in the next section. If you really want to use the original EA85 format, you can to pass --with-bigendian --with-2grain to configure.
Usage:
If you are using C++, chances are you already have an object-oriented design of some kind. You have a collection of objects, related to each other in some way, and you want to write them all to a file in some way. It is, of course, possible to just write them all to the file, one after the other, but that approach makes things difficult if you ever decide to change the structure of those objects, write more or fewer of them, or explain to other people how to read your format. Hence, it is desirable to create some kind of structure in the file, to be able to determine where each objects begins and ends, and what kind of object is where. When using an IFF format, youll make simple objects into chunks, and objects containing other objects into FORMs, LISTs, or CATs.
The first task is to make each of your objects readable and writable through uSTL streams. To do that youll need to define three methods, read, write, and stream_size, and create flow operator overrides with a STD_STREAMABLE macro. Here is a typical example:
#include < iff.h > // iff header includes ustl.h, but doesnt use the namespace.
using namespace ustl; // it is recommended to leave iff:: namespace on.
/// Stores players vital statistics.
class CPlayerStats {
public:
void read (istream& is);
void write (ostream& os) const;
size_t stream_size (void) const;
private:
uint16_t m_HP;
uint16_t m_MaxHP;
uint16_t m_Mana;
uint16_t m_MaxMana;
};
// Since the object is simple, and contains no other objects,
// well make it a simple chunk.
enum { // Define a chunk format for writing this object.
fmt_PlayerStats = IFF_FMT(S,T,A,T)
}; // In a hex editor youll see STAT at the beginning of the object
// making it easy to find when you want to hack something in it.
/// Reads the object from stream p is
void CPlayerStats::read (istream& is)
{
is >> m_HP >> m_MaxHP >> m_Mana >> m_MaxMana;
}
/// Writes the object to stream p os.
void CPlayerStats::write (ostream& os) const
{
os<<less
The Interchange File Format is a simple structured binary file format consisting of sized and typed chunks of data, selectively readable without having to know the format of each chunk.
This functionality is similar to what XML provides for text documents, and the IFF format can indeed be viewed as a sort of a binary XML. IFFs extensibility is an excellent way of not breaking old applications when the file format changes, making it an excellent choice for your next applications data files.
The IFF is also the simplest and the smallest such data format, ensuring that your files consist of real data rather than overhead and that your code spends more time on real work than on parsing the data file. This library defines the IFF header structures and provides simple algorithms for directly writing many of your objects as chunks and containers.
Installation:
This library can be downloaded from SourceForge, as can its sole prerequisite:
libiff - The library source package.
uSTL - An STL implementation, required.
First, unpack and install uSTL, as described in its documentation. Unpack libiff and run ./configure; make install, which will install the library to /usr/local/lib and headers to /usr/local/include. ./configure --help lists available configuration options, in the usual autoconf fashion. The one thing to be aware of is that by default the library will not be completely conforming to EA85 specification. Why that is so, and why you should take the default options anyway, is discussed in detail in the next section. If you really want to use the original EA85 format, you can to pass --with-bigendian --with-2grain to configure.
Usage:
If you are using C++, chances are you already have an object-oriented design of some kind. You have a collection of objects, related to each other in some way, and you want to write them all to a file in some way. It is, of course, possible to just write them all to the file, one after the other, but that approach makes things difficult if you ever decide to change the structure of those objects, write more or fewer of them, or explain to other people how to read your format. Hence, it is desirable to create some kind of structure in the file, to be able to determine where each objects begins and ends, and what kind of object is where. When using an IFF format, youll make simple objects into chunks, and objects containing other objects into FORMs, LISTs, or CATs.
The first task is to make each of your objects readable and writable through uSTL streams. To do that youll need to define three methods, read, write, and stream_size, and create flow operator overrides with a STD_STREAMABLE macro. Here is a typical example:
#include < iff.h > // iff header includes ustl.h, but doesnt use the namespace.
using namespace ustl; // it is recommended to leave iff:: namespace on.
/// Stores players vital statistics.
class CPlayerStats {
public:
void read (istream& is);
void write (ostream& os) const;
size_t stream_size (void) const;
private:
uint16_t m_HP;
uint16_t m_MaxHP;
uint16_t m_Mana;
uint16_t m_MaxMana;
};
// Since the object is simple, and contains no other objects,
// well make it a simple chunk.
enum { // Define a chunk format for writing this object.
fmt_PlayerStats = IFF_FMT(S,T,A,T)
}; // In a hex editor youll see STAT at the beginning of the object
// making it easy to find when you want to hack something in it.
/// Reads the object from stream p is
void CPlayerStats::read (istream& is)
{
is >> m_HP >> m_MaxHP >> m_Mana >> m_MaxMana;
}
/// Writes the object to stream p os.
void CPlayerStats::write (ostream& os) const
{
os<<less
Download (0.026MB)
Added: 2006-12-07 License: MIT/X Consortium License Price:
1056 downloads
UDAT 1.4.1
UDAT is a data format, offering a generic basis for data storage and transmission. more>>
UDAT is a data format, offering a generic basis for data storage and transmission, while being both easily readable by humans and easily readable by machines. It is comparable to formats like XML or YAML, but due to simplicity it is much more easy to parse.
The RubyGems package "udat" contains a library for the ruby programming language to create and parse UDAT documents. UDAT was created especially for software developers.
This project is free for private and commercial use, no warranty, subject to the license agreement in the software.
<<lessThe RubyGems package "udat" contains a library for the ruby programming language to create and parse UDAT documents. UDAT was created especially for software developers.
This project is free for private and commercial use, no warranty, subject to the license agreement in the software.
Download (0.010MB)
Added: 2007-06-07 License: MIT/X Consortium License Price:
870 downloads
Data::Secs2 0.09
Data::Secs2 is a Perl module to pack, unpack, format, transform from Perl data SEMI E5-94 nested data. more>>
Data::Secs2 is a Perl module to pack, unpack, format, transform from Perl data SEMI E5-94 nested data.
SYNOPSIS
#####
# Subroutine interface
#
use Data::Secs2 qw(arrayify config listify neuterify numberify perlify
perl_typify secsify secs_elementify stringify textify transify);
@array = arrayify($ref, @options);
$old_value = config( $option );
$old_value = config( $option => $new_value);
$body = secs_elementify($format, $cells, @options);
@secs_obj = listify(@vars);
@secs_obj = neuterify($binary_secs, @options);
@vars = perlify(@secs_obj, @options);
$ref = perl_typify(@array, @options);
$ascii_secs = secsify( @secs_obj, @options);
$binary_secs = secsify( @secs_obj, type => binary);
$string = stringify(@arg, [@options]);
@secs_obj = transify($acsii_secs, @options);
#####
# Class, Object interface
#
# For class interface, use Data::Secs2 instead of $self
# use Data::Secs2;
#
$secs2 = Data::Secs2 # uses built-in config object
$secs2 = new Data::Secs2( @options );
@array = secs2->arrayify( $ref, @options );
$old_value = secs2->secs_config( $option);
$old_value = secs2->secs_config( $option => $new_value);
$body = secs2->secs_elementify($format, $cells, @options);
@secs_obj = secs2->listify(@vars, @options);
@secs_obj = secs2->neuterify($binary_secs, @options);
@vars = secs2->perlify(@secs_obj, @options);
$ref = secs2->perl_typify(@array, @options);
$ascii_secs = secs2->secsify( @secs_obj, @options);
$binary_secs = secs2->secsify( @secs_obj, type => binary);
$body = secs2->stringify( @arg );
@secs_obj = secs2->transify($acsii_secs, @options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
<<lessSYNOPSIS
#####
# Subroutine interface
#
use Data::Secs2 qw(arrayify config listify neuterify numberify perlify
perl_typify secsify secs_elementify stringify textify transify);
@array = arrayify($ref, @options);
$old_value = config( $option );
$old_value = config( $option => $new_value);
$body = secs_elementify($format, $cells, @options);
@secs_obj = listify(@vars);
@secs_obj = neuterify($binary_secs, @options);
@vars = perlify(@secs_obj, @options);
$ref = perl_typify(@array, @options);
$ascii_secs = secsify( @secs_obj, @options);
$binary_secs = secsify( @secs_obj, type => binary);
$string = stringify(@arg, [@options]);
@secs_obj = transify($acsii_secs, @options);
#####
# Class, Object interface
#
# For class interface, use Data::Secs2 instead of $self
# use Data::Secs2;
#
$secs2 = Data::Secs2 # uses built-in config object
$secs2 = new Data::Secs2( @options );
@array = secs2->arrayify( $ref, @options );
$old_value = secs2->secs_config( $option);
$old_value = secs2->secs_config( $option => $new_value);
$body = secs2->secs_elementify($format, $cells, @options);
@secs_obj = secs2->listify(@vars, @options);
@secs_obj = secs2->neuterify($binary_secs, @options);
@vars = secs2->perlify(@secs_obj, @options);
$ref = secs2->perl_typify(@array, @options);
$ascii_secs = secs2->secsify( @secs_obj, @options);
$binary_secs = secs2->secsify( @secs_obj, type => binary);
$body = secs2->stringify( @arg );
@secs_obj = secs2->transify($acsii_secs, @options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
Download (0.096MB)
Added: 2007-02-15 License: Perl Artistic License Price:
981 downloads
DBD::AnyData 0.08
DBD::AnyData is a DBI access to XML, CSV and other formats. more>>
DBD::AnyData is a DBI access to XML, CSV and other formats.
SYNOPSIS
use DBI;
my $dbh = DBI->connect(dbi:AnyData(RaiseError=>1):);
$dbh->func( trains, CSV, /users/joe/cars.csv, ad_catalog);
$dbh->func( bikes, XML, [$xml_str], ad_import);
$dbh->func( cars, DBI, $mysql_dbh, ad_import);
#
# ... DBI/SQL methods to access/modify the tables cars,bikes,trains
#
print $dbh->func( cars, HTMLtable, ad_export);
or
use DBI;
my $dbh = DBI->connect(dbi:AnyData(RaiseError=>1):);
$dbh->func( Pipe, data.pipe, XML, data.xml, ad_convert);
or
(many combinations of a dozen other data formats, see below)
The DBD::AnyData module provides a DBI/SQL interface to data in many formats and from many sources.
Currently supported formats include general format flatfiles (CSV, Fixed Length, Tab or Pipe "delimited", etc.), specific formats (passwd files, web logs, etc.), a variety of other kinds of formats (XML, Mp3, HTML tables), and, for some operations, any DBI accessible database. The number of supported formats will continue to grow rapidly since there is an open API making it easy for any author to create additional format parsers which can be plugged in to AnyData.
Data in these various formats can come from local files, from remote files, or from perl data structures such as strings and arrays.
Regardless of the format or source of the data, it may be accessed and/or modified using all standard DBI methods and a subset of SQL syntax.
In addition to standard database access to files, the module also supports in-memory tables which allow you to create temporary views; to combine data from a number of sources; to quickly prototype database systems; and to display or save the data in any of the supported formats (e.g. to display data in a CSV file as an HTML table).
These in-memory tables can be created from any combination of DBI databases or files of any format. They may also be created from perl data structures which means its possible to quickly prototype a database system without any file access or rdbms backend.
<<lessSYNOPSIS
use DBI;
my $dbh = DBI->connect(dbi:AnyData(RaiseError=>1):);
$dbh->func( trains, CSV, /users/joe/cars.csv, ad_catalog);
$dbh->func( bikes, XML, [$xml_str], ad_import);
$dbh->func( cars, DBI, $mysql_dbh, ad_import);
#
# ... DBI/SQL methods to access/modify the tables cars,bikes,trains
#
print $dbh->func( cars, HTMLtable, ad_export);
or
use DBI;
my $dbh = DBI->connect(dbi:AnyData(RaiseError=>1):);
$dbh->func( Pipe, data.pipe, XML, data.xml, ad_convert);
or
(many combinations of a dozen other data formats, see below)
The DBD::AnyData module provides a DBI/SQL interface to data in many formats and from many sources.
Currently supported formats include general format flatfiles (CSV, Fixed Length, Tab or Pipe "delimited", etc.), specific formats (passwd files, web logs, etc.), a variety of other kinds of formats (XML, Mp3, HTML tables), and, for some operations, any DBI accessible database. The number of supported formats will continue to grow rapidly since there is an open API making it easy for any author to create additional format parsers which can be plugged in to AnyData.
Data in these various formats can come from local files, from remote files, or from perl data structures such as strings and arrays.
Regardless of the format or source of the data, it may be accessed and/or modified using all standard DBI methods and a subset of SQL syntax.
In addition to standard database access to files, the module also supports in-memory tables which allow you to create temporary views; to combine data from a number of sources; to quickly prototype database systems; and to display or save the data in any of the supported formats (e.g. to display data in a CSV file as an HTML table).
These in-memory tables can be created from any combination of DBI databases or files of any format. They may also be created from perl data structures which means its possible to quickly prototype a database system without any file access or rdbms backend.
Download (0.020MB)
Added: 2006-11-11 License: Perl Artistic License Price:
1077 downloads
Data::CTable 1.03
Data::CTable is a Perl module that helps you read, write, manipulate tabular data. more>>
Data::CTable is a Perl module that helps you read, write, manipulate tabular data.
SYNOPSIS
## Read some data files in various tabular formats
use Data::CTable;
my $People = Data::CTable->new("people.merge.mac.txt");
my $Stats = Data::CTable->new("stats.tabs.unix.txt");
## Clean stray whitespace in fields
$People->clean_ws();
$Stats ->clean_ws();
## Retrieve columns
my $First = $People->col(FirstName);
my $Last = $People->col(LastName );
## Calculate a new column based on two others
my $Full = [map {"$First->[$_] $Last->[$_]"} @{$People->all()}];
## Add new column to the table
$People->col(FullName => $Full);
## Another way to calculate a new column
$People->col(Key);
$People->calc(sub {no strict vars; $Key = "$Last,$First";});
## "Left join" records matching Stats:PersonID to People:Key
$Stats->join($People, PersonID => Key);
## Find certain records
$Stats->select_all();
$Stats->select(Department => sub {/Sale/i }); ## Sales depts
$Stats->omit (Department => sub {/Resale/i}); ## not Resales
$Stats->select(UsageIndex => sub {$_ > 20.0}); ## high usage
## Sort the found records
$Stats->sortspec(DeptNum , {SortType => Integer});
$Stats->sortspec(UsageIndex, {SortType => Number });
$Stats->sort([qw(DeptNum UsageIndex Last First)]);
## Make copy of table with only found/sorted data, in order
my $Report = $Stats->snapshot();
## Write an output file
$Report->write(_FileName => "Rept.txt", _LineEnding => "mac");
## Print a final progress message.
$Stats->progress("Done!");
## Dozens more methods and parameters available...
OVERVIEW
Data::CTable is a comprehensive utility for reading, writing, manipulating, cleaning and otherwise transforming tabular data. The distribution includes several illustrative subclasses and utility scripts.
A Columnar Table represents a table as a hash of data columns, making it easy to do data cleanup, formatting, searching, calculations, joins, or other complex operations.
The objects hash keys are the field names and the hash values hold the data columns (as array references).
Tables also store a "selection" -- a list of selected / sorted record numbers, and a "field list" -- an ordered list of all or some fields to be operated on. Select() and sort() methods manipulate the selection list. Later, you can optionally rewrite the table in memory or on disk to reflect changes in the selection list or field list.
Data::CTable reads and writes any tabular text file format including Merge, CSV, Tab-delimited, and variants. It transparently detects, reads, and preserves Unix, Mac, and/or DOS line endings and tab or comma field delimiters -- regardless of the runtime platform.
In addition to reading data files, CTable is a good way to gather, store, and operate on tabular data in memory, and to export data to delimited text files to be read by other programs or interactive productivity applications.
To achieve extremely fast data loading, CTable caches data file contents using the Storable module. This can be helpful in CGI environments or when operating on very large data files. CTable can read an entire cached table of about 120 megabytes into memory in about 10 seconds on an average mid-range computer.
For simple data-driven applications needing to store and quickly retrieve simple tabular data sets, CTable provides a credible alternative to DBM files or SQL.
For data hygiene applications, CTable forms the foundation for writing utility scripts or compilers to transfer data from external sources, such as FileMaker, Excel, Access, personal organizers, etc. into compiled or validated formats -- or even as a gateway to loading data into SQL databases or other destinations. You can easily write short, repeatable scripts in Perl to do reporting, error checking, analysis, or validation that would be hard to duplicate in less-flexible application environments.
The data representation is simple and open so you can directly access the data in the object if you feel like it -- or you can use accessors to request "clean" structures containing only the data or copies of it. Or you can build your own columns in memory and then when youre ready, turn them into a table object using the very flexible new() method.
The highly factored interface and implementation allow fine-grained subclassing so you can easily create useful lightweight subclasses. Several subclasses are included with the distribution.
Most defaults and parameters can be customized by subclassing, overridden at the instance level (avoiding the need to subclass too often), and further overridden via optional named-parameter arguments to most major method calls.
<<lessSYNOPSIS
## Read some data files in various tabular formats
use Data::CTable;
my $People = Data::CTable->new("people.merge.mac.txt");
my $Stats = Data::CTable->new("stats.tabs.unix.txt");
## Clean stray whitespace in fields
$People->clean_ws();
$Stats ->clean_ws();
## Retrieve columns
my $First = $People->col(FirstName);
my $Last = $People->col(LastName );
## Calculate a new column based on two others
my $Full = [map {"$First->[$_] $Last->[$_]"} @{$People->all()}];
## Add new column to the table
$People->col(FullName => $Full);
## Another way to calculate a new column
$People->col(Key);
$People->calc(sub {no strict vars; $Key = "$Last,$First";});
## "Left join" records matching Stats:PersonID to People:Key
$Stats->join($People, PersonID => Key);
## Find certain records
$Stats->select_all();
$Stats->select(Department => sub {/Sale/i }); ## Sales depts
$Stats->omit (Department => sub {/Resale/i}); ## not Resales
$Stats->select(UsageIndex => sub {$_ > 20.0}); ## high usage
## Sort the found records
$Stats->sortspec(DeptNum , {SortType => Integer});
$Stats->sortspec(UsageIndex, {SortType => Number });
$Stats->sort([qw(DeptNum UsageIndex Last First)]);
## Make copy of table with only found/sorted data, in order
my $Report = $Stats->snapshot();
## Write an output file
$Report->write(_FileName => "Rept.txt", _LineEnding => "mac");
## Print a final progress message.
$Stats->progress("Done!");
## Dozens more methods and parameters available...
OVERVIEW
Data::CTable is a comprehensive utility for reading, writing, manipulating, cleaning and otherwise transforming tabular data. The distribution includes several illustrative subclasses and utility scripts.
A Columnar Table represents a table as a hash of data columns, making it easy to do data cleanup, formatting, searching, calculations, joins, or other complex operations.
The objects hash keys are the field names and the hash values hold the data columns (as array references).
Tables also store a "selection" -- a list of selected / sorted record numbers, and a "field list" -- an ordered list of all or some fields to be operated on. Select() and sort() methods manipulate the selection list. Later, you can optionally rewrite the table in memory or on disk to reflect changes in the selection list or field list.
Data::CTable reads and writes any tabular text file format including Merge, CSV, Tab-delimited, and variants. It transparently detects, reads, and preserves Unix, Mac, and/or DOS line endings and tab or comma field delimiters -- regardless of the runtime platform.
In addition to reading data files, CTable is a good way to gather, store, and operate on tabular data in memory, and to export data to delimited text files to be read by other programs or interactive productivity applications.
To achieve extremely fast data loading, CTable caches data file contents using the Storable module. This can be helpful in CGI environments or when operating on very large data files. CTable can read an entire cached table of about 120 megabytes into memory in about 10 seconds on an average mid-range computer.
For simple data-driven applications needing to store and quickly retrieve simple tabular data sets, CTable provides a credible alternative to DBM files or SQL.
For data hygiene applications, CTable forms the foundation for writing utility scripts or compilers to transfer data from external sources, such as FileMaker, Excel, Access, personal organizers, etc. into compiled or validated formats -- or even as a gateway to loading data into SQL databases or other destinations. You can easily write short, repeatable scripts in Perl to do reporting, error checking, analysis, or validation that would be hard to duplicate in less-flexible application environments.
The data representation is simple and open so you can directly access the data in the object if you feel like it -- or you can use accessors to request "clean" structures containing only the data or copies of it. Or you can build your own columns in memory and then when youre ready, turn them into a table object using the very flexible new() method.
The highly factored interface and implementation allow fine-grained subclassing so you can easily create useful lightweight subclasses. Several subclasses are included with the distribution.
Most defaults and parameters can be customized by subclassing, overridden at the instance level (avoiding the need to subclass too often), and further overridden via optional named-parameter arguments to most major method calls.
Download (0.15MB)
Added: 2007-07-13 License: Perl Artistic License Price:
833 downloads
Sparklines for Java 1.2
Sparklines are intense, simple, wordlike graphics. more>>
Sparklines are intense, simple, wordlike graphics.
Theres a PHP library for producing sparklines, and even a sparkline web service, but I wanted something I could use to generate sparklines in both Java and JSTL (and I thought it would be a fun project). (Its also worth checking out Whys minimalist python sparklines, which encode the image data directly in the HTML as a data: URI [this library allows you to encode the images as using either data: format or javascript: format (supported by IE) in JSTL])
JSTL examples
< %@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" % >
< %@ taglib prefix="spark" uri="http://www.representqueens.com/taglibs/spark" % >
< c:set var="test" value="5, 35, 22, 19, 16, 10, 4, 33, 9, 12, 27, 36, 22" / >
< img src="< spark:bar name="test" color="red" / >" / >
will produce:
(I think the default size might be a little large).
The "name" attribute specifies the key to find the data (Uses JspContext.findAttribute). It expects the value to be either a List , a Number[], or a String of comma separated int values. Its the only manditory attribute.
The other attributes are width, height, spacing, color, highColor, lastColor, output. You can replace "bar" with "line" to get a linegraph (note: highColor and lastColor are currently not supported for line graphs).
The color attributes can either be a color name (a field name from java.awt.Color), or a HTML hex color (e.g. #ff0000 for red).
Enhancements:
- This release properly URL encodes parameters for server generated sparklines.
- This fixes an issue when using hex specified image colors.
- The tag parameter "background" has been added as a workaround for IE6 PNG transparency.
<<lessTheres a PHP library for producing sparklines, and even a sparkline web service, but I wanted something I could use to generate sparklines in both Java and JSTL (and I thought it would be a fun project). (Its also worth checking out Whys minimalist python sparklines, which encode the image data directly in the HTML as a data: URI [this library allows you to encode the images as using either data: format or javascript: format (supported by IE) in JSTL])
JSTL examples
< %@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" % >
< %@ taglib prefix="spark" uri="http://www.representqueens.com/taglibs/spark" % >
< c:set var="test" value="5, 35, 22, 19, 16, 10, 4, 33, 9, 12, 27, 36, 22" / >
< img src="< spark:bar name="test" color="red" / >" / >
will produce:
(I think the default size might be a little large).
The "name" attribute specifies the key to find the data (Uses JspContext.findAttribute). It expects the value to be either a List , a Number[], or a String of comma separated int values. Its the only manditory attribute.
The other attributes are width, height, spacing, color, highColor, lastColor, output. You can replace "bar" with "line" to get a linegraph (note: highColor and lastColor are currently not supported for line graphs).
The color attributes can either be a color name (a field name from java.awt.Color), or a HTML hex color (e.g. #ff0000 for red).
Enhancements:
- This release properly URL encodes parameters for server generated sparklines.
- This fixes an issue when using hex specified image colors.
- The tag parameter "background" has been added as a workaround for IE6 PNG transparency.
Download (0.030MB)
Added: 2007-03-14 License: The Apache License 2.0 Price:
956 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above data format search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed