Globally replace text in several files: Difference between revisions
Content deleted Content added
→{{header|C}}: replaced incorrect code |
added OpenEdge solution |
||
Line 171:
fp:close()
end</lang>
=={{header|OpenEdge/Progress}}==
<lang progress>FUNCTION replaceText RETURNS LOGICAL (
i_cfile_list AS CHAR,
i_cfrom AS CHAR,
i_cto AS CHAR
):
DEF VAR ii AS INT.
DEF VAR lcfile AS LONGCHAR.
DO ii = 1 TO NUM-ENTRIES( i_cfile_list ):
COPY-LOB FROM FILE ENTRY( ii, i_cfile_list ) TO lcfile.
lcfile = REPLACE( lcfile, i_cfrom, i_cto ).
COPY-LOB FROM lcfile TO FILE ENTRY( ii, i_cfile_list ).
END.
END FUNCTION. /* replaceText */
replaceText(
"a.txt,b.txt,c.txt",
"Goodbye London!",
"Hello New York!"
).</lang>
=={{header|Perl}}==
|