Openedge 在现有文本文件的开头添加文本

问题描述

在 xml 文件末尾的附加文本中找到了一些知识库

https://knowledgebase.progress.com/articles/Article/P8379

OUTPUT TO VALUE ("cust.xml") APPEND.
/* Append a new line character to the end of the file */
PUT UNFORMATTED "~n ".
/* Append some text after the new line character */
PUT UNFORMATTED "this is the appended text".
OUTPUT CLOSE.

有没有类似的在开头添加文字解决方案?或者我必须求助于导入文件并将其重写为新文件

谢谢

解决方法

你将不得不阅读它并重新编写它。这是一种方法:

define variable fileBody as longchar no-undo.

copy-lob from file "test" to fileBody.

fileBody = "new first line~n" + fileBody.

copy-lob from fileBody to file "test".