Match specific pattern and print just the matched string in the previous line: Updated
问题 I have a .fastq file formatted in the following way @M01790:39:000000000-C3C6P:1:1101:14141:1618 1:N:0:8 (name) AACATCTACATATTCACATATAGACATGAAACACCTGTGGTTCTTCCTCAGTATGTAGGACTGTAACATAG (sequence) + GGACCCGGGGGGGGGDGGGFGGGGGGFGGGGGGGGGGGFGGGGFGFGFFFGGGGGGFGGGGGGGGGGGFGG (quality) For each sequence the format is the same (repetition of 4 lines) What I am trying to do is searching for specific regex pattern in a window of n=35 characters of the 2nd line, cut it if found and report it at the end