Batch append text in TextMate

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"


This is one of about 5000 posts on Rubénerd. View the home page for the latest, or related posts also tagged with:

If you liked this post, feel free to buy me a coffee, leave me a comment on Twitter, or email me at Thanks :).