delete all new lines '\n' between two intances of a pattern using sed or awk : I have this input file as input.txt as shown below
In the output
I am trying to delete all new lines between the all occurances of pattern '------'.
Then delete that pattern from the output file
print_me(0034 bla bla bla bla bla bla bla bla bla.)
and insert a new line with string containing the number, such as
printername('0034')


input.txt

print_me 0034 bla bla bla bla bl
              a bla bla bla bla.
------ -------------------------
print_me 0035 bla bla bla bla bl
              a bla bla bla bla.
------ -------------------------
print_me 0037 bla bla bla bla bl
              a bla bla bla bla.
------ -------------------------
print_me 0038 bla bla bla bla bl
              a bla bla bla bla.
------ -------------------------

desired output.txt
printername('0034')
print_me(0034 bla bla bla bla bla bla bla bla bla.)
printername('0035')
print_me(0035 bla bla bla bla bla bla bla bla bla.)
printername('0036')
print_me(0036 bla bla bla bla bla bla bla bla bla.)
printername('0037')
print_me(0037 bla bla bla bla bla bla bla bla bla.)
printername('0038')
print_me(0038 bla bla bla bla bla bla bla bla bla.)

