Function s = filefragmentread(fn,fragmid)
s = filefragmentread(fn,fragmid,wipe_1st_col)
s = filefragmentread(fn,fragmid,wipe_1st_col,s_start,s_interm,s_end)
[s,ir,ic] = filefragmentread(...)
[s,ir,ic,err] = filefragmentread(...)
reads a fragment indicated by fragment identifier
fragmid from a file with filename fn. The fragment
with its identifier is delimited by the three special
strings:
s_start fragmid s_interm ...fragment... s_end
These special strings may be input; they may not be
empty. Their defaults are:
s_start = "<fragment>"
s_interm = "</fragment/>"
s_end = "</fragment>"
If input argument wipe_1st_col is true, a percent
or hash character occurring in the first column of
each line is replaced by a space.
The optional output arguments ir and ic contain the
line index and column index where the contents of the
fragment starts in the file.
When no errors occur, the optional output argument
err contains an error message; otherwise it is an
empty string. If the output argument is not requested,
the error message will be printed on screen rightaway.
(c) 2026 fabien van mook
2026.08.20 release of this file within package "fvm-miscellaneous" under GNU GPLv3+