file_increment


file_increment, a MATLAB code 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 information on this web page is distributed under the MIT license.

Languages:

file_increment is available in a MATLAB version.

Related Data and Programs:

file_increment_test

filum a MATLAB code which can work with information in text files.

Source Code:


Last revised on 21 January 2019.