On Thu, 25 May 2006, Mike Blonder might have said:

> Hi.
> 
> I cannot find a good example in the documentation that would help me use
> VIM to accomplish what I need to do:
> 
> I need to add 6 lines to each of thousands of files.  The location for
> the lines to be added is the same and definable in a command.  Anybody
> have any ideas as to a straightforward way to get this done?  I've tried
> copying the lines to a register and then inserting the register text
> into an argdo command, but I cannot finish writing the command before
> VIM starts inserting the text.  Also, I noted that VIM will not insert
> beyond the end of the first line.
> 
> Thanks for any ideas on this.
> 
> Mike
> 
> 
> 

echo "line1" >> tempfile
echo "line2" >> tempfile
echo "line3" >> tempfile

$ cd /location/of/files
$ find . -type f -print | while read file
do
cat tempfile >> $file
done

Reply via email to