I would like to update a large number of C++ source files with an extra include directive before any existing #includes. For this sort of task, I normally use a small bash s
Just add the number of occurrence at the end:
sed s/#include/#include "newfile.h"\n#include/1