CLI
Use sed to Insert Text Every 'n' Lines/Characters
There are a lot of overly complicated ways to insert a line after every nth line, but the simplest way I find is the following: sed '0~3 s/$/\nMy Text/g' < input.file In a file with six lines you get something like the following: Line 1 Line 2