i have a file:
unreliable, random content, multiple lines
this_line_is_always_the_same_and_never_repeated_in_file
unreliable, random content, SINGLE line
unreliable, random content, multiple lines
each of the unreliable, random content, multiple lines
is a random number of lines, with random text
i am trying to create a .patch
file that adds 4 lines to the above file like this:
unreliable, random content, multiple lines
this_line_is_always_the_same_and_never_repeated_in_file
unreliable, random content, SINGLE line
my_new_line_1
my_new_line_2
...
unreliable, random content, multiple lines
(when i say random, it isnt really random, i just mean that no 2 files being patched will have the same things)
i have no idea how to add content 2 lines after a line,
any help would be appreciated
sorry if i havent formatted this question correctly
EDIT: just adding that i cant rely on line numbers either, and this is my first time trying to use diff and patch
sed
or similar? Those are meant for pattern matching and could add content. Whilepatch
should apply adiff
to a file. Adiff
is a line by line comparison.