Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make text replacement in automator (regex)

I am making an Automator application and I need to replace some text based on a certain criteria. I am wondering if there is an Automator action for performing a regex text replacement.

If not, I always have the option to run an AppleScript that can do this, but I really don't know how to write AppleScript code.

Thanks!

like image 599
Sorin Buturugeanu Avatar asked Nov 28 '10 06:11

Sorin Buturugeanu


1 Answers

There's no dedicated Automator action for this, but you can use the "Run Shell Script" action. It can receive its input on stdin or as arguments, and you can just use sed, awk, perl, ruby, or whatever you're comfortable with to do the replacement.

like image 141
Antal Spector-Zabusky Avatar answered Nov 11 '22 05:11

Antal Spector-Zabusky