is there a tool that can help me to batch edit text files in a certain folder?
I need to delete or insert snippets repeatedly in lots of html files and restructure them.
Thanks in advance!
is there a tool that can help me to batch edit text files in a certain folder?
I need to delete or insert snippets repeatedly in lots of html files and restructure them.
Thanks in advance!
sed, the stream editor, is your friend here. For example.
would change all the paragraphs with the id 'first' to id 'second' in file.html, and create file.html.bak into the bargain.
As Julian showed,
sed
is the right tool for that.I just want to add two remarks:
you can process multiple files at once, just by providing list of files:
Also, if you need to work with some Snippets manually, you can enable Snippets plugin in gedit:
Edit -> Preferences -> Plugins -> Snippets. You might find it handy.