VI questions : mass changes, mass delete and external insert

Is it possible in VI to do a global change but take the search patterns and the replacement patterns from an external file ?

I have cases where I can have 100,200 or 300+ global changes to do. All the new records are inside a file and I must VI a work file to change all of them.

Also, can I do a mass delete on records given by an external file no matter where those records are in VI ?

And insert content of a whole file at any given point in VI ?

I do not think I have autority to replace or recreate the files I am editing at the office. Only the search pattern files I can create as I like.

I think a more appropriate solution is to use sed.

$ sed -f script_file file_to_be_changed

script_file contains the many search and replace operations you have...like:
....
s/abc/def/g
s/^[a-z]/x/g
/pattern/d
......

$ man sed (to know more) :slight_smile: