Jump to content

File input/output: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 2,487:
(out "output.txt"
(echo) ) )</lang>
 
=={{header|Pike}}==
===Line by line===
<lang Pike>
object lines = Stdio.File("input.txt")->line_iterator();
object out = Stdio.File("output.txt", "cw");
foreach(lines; int line_number; string line)
out->write(line + "\n");
</lang>
Note that "\r" will be passed on like any other character. If line_iterator is called with the argument 1 it will however run in trim mode, and all "\r"s will be discarded.
 
=={{header|PL/I}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.