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.093 Times

File::Sort 1.01

  Date Added: October 17, 2010  |  Visits: 748

File::Sort

Report Broken Link
Printer Friendly Version


Product Homepage
Download (74 downloads)



File::Sort is a Perl module to sort a file or merge sort multiple files. SYNOPSIS use File::Sort qw(sort_file); sort_file({ I => [qw(file_1 file_2)], o => file_new, k => 5.3,5.5rn, -t => | }); sort_file(file1, file1.sorted); This module sorts text files by lines (or records). Comparisons are based on one or more sort keys extracted from each line of input, and are performed lexicographically. By default, if keys are not given, sort regards each input line as a single field. The sort is a merge sort. If you dont like that, feel free to change it. Options The following options are available, and are passed in the hash reference passed to the function in the format: OPTION => VALUE Where an option can take multiple values (like I, k, and pos), values may be passed via an anonymous array: OPTION => [VALUE1, VALUE2] Where the OPTION is a switch, it should be passed a boolean VALUE of 1 or 0. This interface will always be supported, though a more perlish interface may be offered in the future, as well. This interface is basically a mapping of the command-line options to the Unix sort utility. I INPUT Pass in the input file(s). This can be either a single string with the filename, or an array reference containing multiple filename strings. c Check that single input fle is ordered as specified by the arguments and the collating sequence of the current locale. No output is produced; only the exit code is affected. m Merge only; the input files are assumed to already be sorted. o OUTPUT Specify the name of an OUTPUT file to be used instead of the standard output. u Unique: Suppresses all but one in each set of lines having equal keys. If used with the c option check that there are no lines with consecutive lines with duplicate keys, in addition to checking that the input file is sorted. y MAX_SORT_RECORDS Maximum number of lines (records) read before writing to temp file. Default is 200,000. This may eventually change to be kbytes instead of lines. Lines was easier to implement. Can also specify with MAX_SORT_RECORDS environment variable. F MAX_SORT_FILES Maximum number of temp files to be held open at once. Default to 40, as older Windows ports had quite a small limit. Can also specify with MAX_SORT_FILES environment variable. No temp files will be used at all if MAX_SORT_RECORDS is never reached. D Send debugging information to STDERR. Behavior subject to change. The following options override the default ordering rules. When ordering options appear independent of any key field specifications, the requested field ordering rules are applied globally to all sort keys. When attached to a specific key (see k), the specified ordering options override all global ordering options for that key. d Specify that only blank characters and alphanumeric characters, according to the current locale setting, are significant in comparisons. d overrides i. f Consider all lower-case characters that have upper-case equivalents, according to the current locale setting, to be the upper-case equivalent for the purposes of comparison. i Ignores all characters that are non-printable, according to the current locale setting. n Does numeric instead of string compare, using whatever perl considers to be a number in numeric comparisons. r Reverse the sense of the comparisons. b Ignore leading blank characters when determining the starting and ending positions of a restricted sort key. If the b option is specified before the first k option, it is applied to all k options. Otherwise, the b option can be attached indepently to each field_start or field_end option argument (see below). t STRING Use STRING as the field separator character; char is not considered to be part of a field (although it can be included in a sort key). Each occurrence of char is significant (for example, delimits an empty field). If t is not specified, blank characters are used as default field separators; each maximal non-empty sequence of blank characters that follows a non-blank character is a field separator. X STRING Same as t, but STRING is interpreted as a Perl regular expression instead. Do not escape any characters (/ characters need to be escaped internally, and will be escaped for you). The string matched by STRING is not included in the fields themselves, unless demanded by perls regex and split semantics (e.g., regexes in parentheses will add that matched expression as an extra field). See perlre and "split" in perlfunc. R STRING Record separator, defaults to newline. k pos1[,pos2] The keydef argument is a restricted sort key field definition. The format of this definition is: field_start[.first_char][type][,field_end[.last_char][type]] where field_start and field_end define a key field restricted to a portion of the line, and type is a modifier from the list of characters b, d, f, i, n, r. The b modifier behaves like the b option, but applies only to the field_start or field_end to which it is attached. The other modifiers behave like the corresponding options, but apply only to the key field to which they are attached; they have this effect if specified with field_start, field_end, or both. If any modifier is attached to a field_start or a field_end, no option applies to either. Occurrences of the k option are significant in command line order. If no k option is specified, a default sort key of the entire line is used. When there are multiple keys fields, later keys are compared only after all earlier keys compare equal. Except when the u option is specified, lines that otherwise compare equal are ordered as if none of the options d, f, i, n or k were present (but with r still in effect, if it was specified) and with all bytes in the lines significant to the comparison. The order in which lines that still compare equal are written is unspecified. pos +pos1 [-pos2] Similar to k, these are mostly obsolete switches, but some people like them and want to use them. Usage is: +field_start[.first_char][type] [-field_end[.last_char][type]] Where field_end in k specified the last position to be included, it specifes the last position to NOT be included. Also, numbers are counted from 0 instead of 1. pos2 must immediately follow corresponding +pos1. The rest should be the same as the k option. Mixing +pos1 pos2 with k is allowed, but will result in all of the +pos1 pos2 options being ordered AFTER the k options. It is best if you Dont Do That. Pick one and stick with it. Here are some equivalencies: pos => +1 -2 -> k => 2,2 pos => +1.1 -1.2 -> k => 2.2,2.2 pos => [+1 -2, +3 -5] -> k => [2,2, 4,5] pos => [+2, +0b -1] -> k => [3, 1b,1] pos => +2.1 -2.4 -> k => 3.2,3.4 pos => +2.0 -3.0 -> k => 3.1,4.0.

Requirements: No special requirements
Platforms: Linux
Keyword: Field File File Or Filesort Instead Of Key Field Max Merge Sort Options Perl Module Records Sort A File Sort Key String
Users rating: 0/10

License: Freeware Size: 32.77 KB
USER REVIEWS
More Reviews or Write Review


FILE::SORT RELATED
Libraries  -  Gtk2::Ex::Dialogs::ChooseDirectory 0.11
Gtk2::Ex::Dialogs::ChooseDirectory is a Perl module that provides a file selection dialog. SYNOPSIS use Gtk2::Ex::Dialogs::ChooseDirectory ( destroy_with_parent => TRUE, modal => TRUE ); # do some stuff like creating your apps main $window...
20.48 KB  
Libraries  -  Gtk2::Ex::Dialogs::ChooseFile 0.11
Gtk2::Ex::Dialogs::ChooseFile is a Perl module that provides a file selection dialog. SYNOPSIS use Gtk2::Ex::Dialogs::ChooseFile ( destroy_with_parent => TRUE, modal => TRUE ); # do some stuff like creating your apps main $window then, #...
20.48 KB  
Libraries  -  Gtk2::Ex::Dialogs::ChoosePreviewFile 0.11
Gtk2::Ex::Dialogs::ChoosePreviewFile is a Perl module that provides a file selection dialog. SYNOPSIS use Gtk2::Ex::Dialogs::ChoosePreviewFile ( destroy_with_parent => TRUE, modal => TRUE ); # do some stuff like creating your apps main...
20.48 KB  
Libraries  -  Tie::Form 0.02
Tie::Form is a Perl module to access a machine readable database file that minics a hardcopy form. SYNOPSIS require Tie::Form; ##### # Using support methods and file handle with # the file subroutines such as open(), readline() # print(),...
89.09 KB  
Libraries  -  File::Find 5.8.8
File::Find is a Perl module to traverse a directory tree. SYNOPSIS use File::Find; find(&wanted, @directories_to_search); sub wanted { ... } use File::Find; finddepth(&wanted, @directories_to_search); sub wanted { ... } use File::Find;...
12.2 MB  
Libraries  -  Config::File 1.4
Config::File is a Perl module to parse a simple configuration file. SYNOPSIS use Config::File; my $config_hash = Config::File::read_config_file($configuration_file); read_config_file parses a simple configuration file and stores its values...
4.1 KB  
Libraries  -  File::Revision 0.03
File::Revision is a Perl module to return a name of non-existing backup file with a revision id. SYNOPSIS ####### # Subroutine interface # use File::Revision qw(new_revision num2revision parse_options revision2num revision_file rotate);...
89.09 KB  
Libraries  -  File::Format::RIFF 1.0.1
File::Format::RIFF is a Perl module to Resource Interchange File Format/RIFF files. SYNOPSIS use File::Format::RIFF; open( IN, file ) or die "Could not open file: $!"; my ( $riff1 ) = File::Format::RIFF->read( *IN ); close( IN );...
9.22 KB  
Libraries  -  File::Maker 0.05
File::Maker is a Perl module that mimics a make by loading a database and calling targets methods. SYNOPSIS ##### # Subroutine interface # use File::Maker qw(load_db); %data = load_db($pm); ###### # Object interface # require...
77.82 KB  
Libraries  -  Pod::BBCode 1.5
Pod::BBCode is a Perl module that converts a POD file to a page using BB code. SYNOPSIS use Pod::BBCode; my $p = new Pod::BBCode(-headcolor=>red,-itemcolor=>blue,-textcolor=>black); $p->parse_from_file(in.pod); This class converts a file...
11.26 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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 freedesktop.org, 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