FILE_NAME_SEQUENCE
Create an Increasing Sequence of Filenames {#file_name_sequence-create-an-increasing-sequence-of-filenames align="center"}
FILE_NAME_SEQUENCE is a C++ library which demonstrates ways of generating a sequence of file names with an embedded index that increases.
There are situations such as animations or parallel processing in which it is necessary to generate a sequence of file names which include an embedded index that increases. A simple example might be
"fred0.txt", "fred1.txt", "fred2.txt"
A side issue arises when the number of files is large enough that the number of digits in the index will vary. Thus, if we are going to have 15 files, do we want to number them as
"fred00.txt" through "fred14.txt"
which means, for one thing, that they will alphabetize properly, or will we be satisfied with
"fred0.txt" through "fred14.txt" ?
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
FILE_NAME_SEQUENCE is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version and a Python version.
FILUM, a C++ library which can work with information in text files.
- file_name_sequence.cpp the source code.
- file_name_sequence.hpp the include file.
- file_name_sequence_prb.cpp a test program;
- file_name_sequence_prb_output.txt the output file;
- FILE_NAME_INC increments a partially numeric file name.
- S_LEN_TRIM returns the length of a string to the last nonblank.
- TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to the C++ source codes.
Last revised on 23 July 2012.