How can I insert a set of lines (about 5) into a file at the first place a string is found?
For example:
BestAnimals.txt
dog
awk -v insert=giraffe -v before=cat ' $1 == before && ! inserted { print insert inserted++ } {print} ' BestAnimals.txt > NewBestAnimals.txt