FILUM
File Utilities
FILUM is a FORTRAN77 library
which can work with information in text files.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Related Data and Programs:
CR2LF
is a C++ program which
reads a text file and replaces carriage returns by line feeds.
CRRM
is a C++ program which
reads a text file and removes the carriage return character.
DEBLANK
is a C++ program which
reads a text file and writes a copy which has no blank lines.
DECOMMENT
is a C++ program which
makes a copy of a text file which contains no "comment" lines
(that begin with "#").
FILE_MERGE
is a FORTRAN90 program which
merges two sorted files.
FILUM is also available in
a C version and
a C++ version and
a FORTRAN90 version and
a Mathematica version and
a MATLAB version.
REFORMAT
is a FORTRAN90 program which
makes a copy of a file with a given number of "words" per line.
REWORD
is a C++ program which
reads a text file and writes a copy which has a fixed number
of "words" per line.
UNCONTROL
is a C++ program which
makes a copy of a text file which contains no control characters.
WRAP
is a C++ program which
makes a copy of a text file
in which no line is longer than a user-specified wrap length.
WRAP2
is a C++ program which
wraps long lines in a text file, but which
wraps some lines "early", so as to avoid breaking words.
Reference:
-
Paul Bratley, Bennett Fox, Linus Schrage,
A Guide to Simulation,
Springer Verlag, pages 201-202, 1983.
-
Tom Christiansen, Nathan Torkington,
"8.6: Picking a Random Line from a File",
Perl Cookbook, pages 284-285,
O'Reilly, 1999.
-
Pierre L'Ecuyer,
Random Number Generation,
in Handbook of Simulation,
edited by Jerry Banks,
Wiley Interscience, page 95, 1998.
-
Bennett Fox,
Algorithm 647:
Implementation and Relative Efficiency of Quasirandom
Sequence Generators,
ACM Transactions on Mathematical Software,
Volume 12, Number 4, pages 362-376, 1986.
-
Philip Lewis, Allen Goodman, James Miller,
A Pseudo-Random Number Generator for the System/360,
IBM Systems Journal,
Volume 8, pages 136-143, 1969.
Source Code:
Examples and Tests:
Files used for some of the tests include:
List of Routines:
-
CH_CAP capitalizes a single character.
-
CH_EQI is a case insensitive comparison of two characters for equality.
-
CH_IS_DIGIT returns TRUE if a character is a decimal digit.
-
CH_LOW lowercases a single character.
-
CH_SWAP swaps two characters.
-
CH_TO_DIGIT returns the integer value of a base 10 digit.
-
CH_TO_ROT13 converts a character to its ROT13 equivalent.
-
DIGIT_INC increments a decimal digit.
-
DIGIT_TO_CH returns the character representation of a decimal digit.
-
FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
-
FILE_DELETE deletes a file if it exists.
-
FILE_NAME_INC generates the next filename in a series.
-
FILE_ROW_COUNT counts the number of row records in a file.
-
GET_UNIT returns a free FORTRAN unit number.
-
I4_UNIFORM returns a scaled pseudorandom I4.
-
S_EQI is a case insensitive comparison of two strings for equality.
-
S_LEN_TRIM returns the length of a string to the last nonblank.
-
S_LOW replaces all uppercase letters by lowercase ones.
-
S_TO_I4 reads an I4 from a string.
-
S_TO_R8 reads an R8 from a string.
-
S_TO_R8VEC reads an R8VEC from a string.
-
S_WORD_COUNT counts the number of "words" in a string.
-
TIMESTAMP prints out the current YMDHMS date as a timestamp.
You can go up one level to
the FORTRAN77 source codes.
Last revised on 25 May 2008.