Skip to main content
2 of 6
added 543 characters in body
sergiol
  • 4.2k
  • 1
  • 17
  • 37

Tcl, 126 bytes

set A [read [open i.txt r]] puts [set i [open i.txt w]] [read [open o.txt r]] puts [set o [open o.txt w]] $A close $i close $o 

Try it online!

---

Tcl, 169 bytes

set A [read [set i [open i.txt r]]] set B [read [set o [open o.txt r]]] close $i close $o puts [set i [open i.txt w]] $B puts [set o [open o.txt w]] $A close $i close $o 

Try it online!

sergiol
  • 4.2k
  • 1
  • 17
  • 37