Globally replace text in several files: Difference between revisions
Content added Content deleted
m (1GB limit) |
|||
Line 857: | Line 857: | ||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
ctrace.out was just a file that happened to be handy, obviously you'd have to provide your own file list.<br> |
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. |
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) |
<lang Phix>procedure global_replace(string s, string r, sequence file_list) |
||
for i=1 to length(file_list) do |
for i=1 to length(file_list) do |