Batch append text in TextMate

Software

TextMate 2 icon

Good evening. How was your Sunday?

You could do the following so many ways, with so many tools. If you're already in TextMate though, you can still use your regex foo to do some pretty cool stuff to ranges of files.

Case in point: say you have a folder, and you want to append a string to the end of each file.

  1. Hit ⌘F for find
  2. Under "Find", type "Z"
  3. Under "Replace", type "Z" followed by your escaped string
  4. Under "Options", select "Regular Expression"
  5. Under "In", choose the folder containing your target text files
  6. Hit "Replace All"

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!