I would really appreciate scripting Gurus help out there. Thank you so much in advance.We have the following file where a bunch of records (million records) of interest are between the start and end of patterns. The start pattern always start with an A and the end pattern always starts with a Z.Apattern1   somethinghere    #start of pattern always starts with ALine-of-data-here-aaaLine-of-data-here-xxxxxZpattern1  #end of pattern always starts with ZApatternX   somethinghere    #Repeat: start of pattern always starts with ALine-of-data-here-bbbbLine-of-data-here-yyyyLine-of-data-here-nnnnnZpatternXWe Want to transform the data by appending the start pattern (entire line) to the lines within the pattern. We want to remove the end pattern. We want to use sed and/or awk to append the lines that start the pattern (starts with A) to the lines within the pattern (starts with L) and get rid of the end of the pattern (always starts with Z)So the data file would look like this:Apattern1   somethinghere  Line-of-data-here-aaaApattern1   somethinghere   Line-of-data-here-xxxxxApatternX   somethinghere   Line-of-data-here-bbbbApatternX   somethinghere  Line-of-data-here-yyyyApatternX   somethinghere  Line-of-data-here-nnnnn
Find lines between two patterns and append lines with pattern
text processing;awk;sed;python;perl