Globally replace text in several files: Difference between revisions
Globally replace text in several files (view source)
Revision as of 17:26, 11 March 2017
, 7 years ago1GB limit
m (1GB limit) |
|||
Line 857:
=={{header|Phix}}==
ctrace.out was just a file that happened to be handy, obviously you'd have to provide your own file list.<br>
as hinted, you could probably improve on the error handling.<br>
get_text is deliberately limited to 1GB, for larger files use a temporary file, a loop of gets/puts, and delete_file/rename_file at the end.
<lang Phix>procedure global_replace(string s, string r, sequence file_list)
for i=1 to length(file_list) do
|