是否有用于编辑ASCII文件的Progress 4GL语句?

0 progress-4gl

是否有任何4GL语句用于从磁盘编辑ASCII文件,如果是这样的话?

Tom*_*com 8

编辑涉及读取文件,可能使用IMPORT,然后使用字符串函数(如REPLACE())操作文本,最后使用PUT编写结果.像这样的东西:

define stream inFile.
define stream outFile.

define variable txtLine as character no-undo.

input stream inFile from "input.txt".
output stream outFile to "output.txt".

repeat:

  import stream inFile unformatted txtLine.

  txtLine = replace( txtLine, "abc", "123" ).   /* edit something */

  put stream outFile unformatted txtLine skip.

end.

input stream inFile close.
output stream outFile close.
Run Code Online (Sandbox Code Playgroud)