a) i have one huge file, from which i need to extract all the lines that match specific patterns, letus say paterna and patternb. So i need to extract all lines that start with patterna something like ^patterna, and all lines, that start with patternb something like ^patternb.Then write the output to a file named patternapatternb.txtb) how could i make this work with a loop. For example, do the same for patterna2 and patternb2, then do the same with patterna3 and patternb3, so the file will be parsed many times, with new pairs of patterns to match lines each time, and finally the output then would be three files:patternapatternb.txtpatterna2patternb2.txtpatterna3patternb3.txt  sample input001 876786989 74563734 87387600: sometext601: someothertext  001 712345345 87238600: sometext702: differenttext  001 5342989 745632734 873872  600: sometext601: someothertext  001 987345 87238 600: sometext702: differenttext  patterna: ^001patternb: 600: sometextthe output would be a file named 600: sometext.txt001 876786600: sometext001 712345600: sometext001 5342600: sometext001 987600: sometext  Actually, the first element in the pair of patterns, will be the ^001, and the second, each occurrence of a line that starts with three digits, followed by a :, then a space
extract lines from a file based on sequential pair of patterns, and output to separate files
text processing;sed;awk