Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.545.454 Times

List::RewriteElements 0.09

  Date Added: February 24, 2010  |  Visits: 590


Report Broken Link
Printer Friendly Version

Product Homepage
Download (70 downloads)

List::RewriteElements is a Perl module that can create a new list by rewriting elements of a first list. SYNOPSIS use List::RewriteElements; Constructor Simplest case: Input from array, output to STDOUT. $lre = List::RewriteElements->new( { list => @source, body_rule => sub { my $record = shift; $record .= q{additional field}; }, } ); Input from file, output to STDOUT: $lre = List::RewriteElements->new( { file => "/path/to/source/file", body_rule => sub { my $record = shift; $record .= q{,additional field}; }, } ); Provide a different rule for the first element in the list: $lre = List::RewriteElements->new( { file => "/path/to/source/file", header_rule => sub { my $record = shift; $record .= q{,ADDITIONAL HEADER}; }, body_rule => sub { my $record = shift; $record .= q{,additional field}; }, } ); Input from file, output to file: $lre = List::RewriteElements->new( { file => "/path/to/source/file", body_rule => sub { my $record = shift; $record .= q{additional field}; }, output_file => "/path/to/output/file", } ); To name output file, just provide a suffix to filename: $lre = List::RewriteElements->new( { file => "/path/to/source/file", body_rule => sub { my $record = shift; $record .= q{additional field}; }, output_suffix => .out, } ); Provide criteria to suppress output of header or individual record. $lre = List::RewriteElements->new( { file => "/path/to/source/file", header_suppress => sub { my $record = shift; return if $record =~ /$somepattern/; }, body_suppress => sub { my $record = shift; return if $record ne somestring; }, body_rule => sub { my $record = shift; $record .= q{additional field}; }, } ); Generate Output $lre->generate_output(); Report Output Information $path_to_output_file = $lre->get_output_path(); $output_file_basename = $lre->get_output_basename(); $output_row_count = $lre->get_total_rows(); $output_record_count = $lre->get_total_records(); $records_changed = $lre->get_records_changed(); $records_unchanged = $lre->get_records_unchanged(); $records_deleted = $lre->get_records_deleted(); $header_status = $lre->get_header_status(); It is common in many situations for you to receive a flat data file from someone else and have to generate a new file in which each row or record in the incoming file must either (a) be transformed according to some rule before being printing to the new file; or (b) if it meets certain criteria, not output to the new file at all. List::RewriteElements enables you to write such rules and criteria, generate the file of transformed data records, and get back some basic statistics about the transformation. List::RewriteElements is useful when the number of records in the incoming file may be large and you do not want to hold the entire list in memory. Similarly, the newly generated records are not held in memory but are immediately printed to STDOUT or to file. On the other hand, if for some reason you already have an array of records in memory, you can use List::RewriteElements to apply rules and criteria to each element of the array and then print the transformed records (again, without holding the output in memory)..

Requirements: No special requirements
Platforms: Linux
Keyword: Create A File In Memory Libraries Listrewriteelements New Output Perl Module Programming Record Records Rewriteelements Stdout Sub
Users rating: 0/10

License: Freeware Size: 26.62 KB
More Reviews or Write Review

Desktop Utilities  -  Recursively create M3U playlists 1.1
Recursively create M3U playlists is a service menu which can create a file called playlist.m3u in each directories and sub directories. You can edit to change the name of playlist.m3u To install, simply put...
1.02 KB  
Version Control Tools  -  cvsgdiff 0.04
cvsgdiff uses tkdiff or mgdiff to graphically display diffs between CVS revisions of a file in your sandbox. cvsgdiff is basically a graphical version of "cvs diff". If given no arguments, cvsgdiff will launch the graphical diff program once for...
4.1 KB  
Libraries  -  text-vimcolor 0.11
text-vimcolor is a command-line program to syntax color a file in HTML, XML or PDF. SYNOPSIS $ text-vimcolor --format html --full-page FILENAME > OUTPUT.html $ text-vimcolor --format xml FILENAME > OUTPUT.xml $ text-vimcolor --format pdf...
20.48 KB  
Networking Tools  -  MoBlock 0.8
MoBlock is a linux console application that blocks connections from/to hosts listed in a file in peerguardian format (guarding.p2p and p2p.p2b) or ipfilter.dat files. MoBlock project uses iptables ipqueue userspace library and it is very light...
15.36 KB  
Development Tools  -  What's New for Object-Oriented Programming in MATLAB Webinar - Code Examples 1.0
These are the code examples used in the "What's New for Object-Oriented Programming in MATLABdlT«" webinar, which described the new object oriented features in Release 2008a.To use the code, add the top folder to your path. See the test* M-files...
112.64 KB  
Libraries  -  File::Signature 1.009
File::Signature is a Perl module to detect changes to a files content or attributes. SYNOPSIS use File::Signature; my $sig = File::Signature->new(/some/file); # If you have a stringified signature stored in $string # you can create a...
8.19 KB  
Wallpaper Tools  -  Blended 1.6
Blended provides a simple theme designed to blend in with the menu bar to create a smooth appearance. The theme was designed with the Clearlooks GTK2 theme in mind, but works well with other themes that have plain menu bars. Inculdes 4 theme...
Libraries  -  HTML::Latex 1.1
HTML::Latex is a Perl module that creates a Latex file from an HTML file. SYNOPSIS use HTML::Latex my $parser = new HTML::Latex($conffile); $parser->set_option(%options); $parser->add_package(@packages); $parser->ban_tag(@banned);...
48.13 KB  
Libraries  -  File::Save::Home 0.08
File::Save::Home is a Perl module to place file safely under user home directory. SYNOPSIS use File::Save::Home qw( get_home_directory get_subhome_directory_status make_subhome_directory restore_subhome_directory_status...
18.43 KB  
Libraries  -  IPC::SharedCache 1.3
IPC::SharedCache is a Perl module to manage a cache in SysV IPC shared memory. SYNOPSIS use IPC::SharedCache; # the cache is accessed using a tied hash. tie %cache, IPC::SharedCache, ipc_key => AKEY, load_callback => &load,...
19.46 KB  
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB