Syntax
repairtextfileEOF(fname)
Input Parameter
Examples
repairtextfileEOF('/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/SolidGeometry-Code/demos.xml')
Copyright 2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, repairtextfileEOF
, is designed to remove unwanted EOF characters (char(26)) from text files. These characters can cause issues when parsing XML files in browsers. The function is part of the SolidGeometry library and was introduced in version 5.5.
Input Parameters
- fname: The full file path of the text file to be repaired.
Algorithm Steps
- Read the content of the file specified by
fname
using the readtextfile
function. Store the content in the variable txt
.
- Identify all occurrences of the EOF character (char(26)) in
txt
and store the result in the variable eol
.
- Find the first occurrence of the EOF character using
find(eol, 1)
and store the result in fff
.
- Remove all EOF characters from
txt
by selecting only those elements that are not EOF characters.
- If
fff
is not empty, indicating that EOF characters were found:
- Write the corrected text back to the file using
writetextfile
.
- Print a message indicating that the file has been corrected using
dbprintf
.
- If
fff
is empty, indicating no EOF characters were found:
- Print a message indicating that there was no EOF problem in the file using
dbprintf
.
Algorithm explaination created using ChatGPT on 2025-08-19 01:31. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21