Skip to main content
5 of 6
deleted 624 characters in body
sergiol
  • 4.2k
  • 1
  • 17
  • 37

Tcl, 84 bytes

With renaming allowed, things get shorter:

file rename i.txt m file rename -force o.txt i.txt file rename m o.txt file delete m 

Try it online!


# [Tcl], 122 bytes
set A [read [open i.txt]] puts [set i [open i.txt w]] [read [open o.txt]] puts [set o [open o.txt w]] $A close $i close $o 

Try it online!

sergiol
  • 4.2k
  • 1
  • 17
  • 37