我很擅长进步4gl。我试图将一个df文件的内容复制到另一个文件中,我想复制除df文件区域之外的所有内容。这就是我到目前为止所拥有的。
define stream mystream.
input from "C:\OpenEdge\WRK\df file\sample.df".
do while true on endkey undo, leave:
output to "C:\OpenEdge\WRK\df file\test1.df".
end.
output close.
display "finished".
我首先要将第一个df文件的所有内容复制到另一个df文件中,但是现在我得到一个空白文件。请让我知道我哪里出错了。
答案 0 :(得分:0)
要将第一个df文件的所有内容复制到另一个df文件,请使用以下代码:
DEFINE VARIABLE TEXT-STRING AS CHARACTER FORMAT "X(76)".
INPUT FROM "C:\OPENEDGE\WRK\CMD-LOG.DF".
OUTPUT TO "C:\OPENEDGE\WRK\MY.DF".
DO WHILE TRUE ON ENDKEY UNDO, LEAVE:
IMPORT UNFORMATTED TEXT-STRING.
MESSAGE TEXT-STRING .
END.
INPUT CLOSE.
OUTPUT CLOSE.
答案 1 :(得分:0)
这就是我的所作所为:
grep -v AREA < dbname.df > dbname.df2
如果你坚持使用缺少&#34; grep&#34;或者如果你只是想用4gl代码做这件事我会做类似的事情:
define variable lineIn as character no-undo.
input from "dbname.df".
output to "dbname.df2".
repeat:
import unformatted lineIn. /* read the data a whole line at a time */
if lineIn begins " AREA" then next. /* skip lines that start with " AREA" */
put unformatted lineIn skip. /* spit the input line back out */
if lineIn = "" then put unformatted skip(1). /* yes, this is a weird thing */
end.