FILE_INCREMENT
Increment an Integer Array Stored in a File


FILE_INCREMENT, a MATLAB program which increments every entry of an integer array which is stored in a file.

The program is restricted to handling a file that can be recognized as having M lines of text, each line containing N integer values.

The program might be most naturally useful if a given file contains an array of index values that need to be converted between 0-based and 1-based indexing.

Note that the following MATLAB commands will work faster:

        array = load ( 'input_file' );
        array = array + increment;
        save -ASCII 'output_file' array;
      
However, the data is written in real number format, with exponents. I specifically want the output to be integers in recognizably integer formats. I don't care if it takes longer and requires more MATLAB commands.

Usage:

file_increment ( 'input_file', 'output_file', increment )
where

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

FILE_INCREMENT is available in a MATLAB version.

Related Data and Programs:

file_increment_test

FILUM a MATLAB library which can work with information in text files.

TABLE_SCALE, a FORTRAN90 program which reads a TABLE file of N points in M dimensions and creates a copy with every entry scaled by a given scale vector.

TABLE_SHIFT, a FORTRAN90 program which reads a TABLE file of N points in M dimensions, creates a copy with every entry shifted by a given displacement vector.

Source Code:


Last revised on 21 January 2019.