quickest way to select/copy lines containing string from huge txt.gz file
问题 So I have the following sed one liner: sed -e '/^S|/d' -e '/^T|/d' -e '/^#D=/d' -e '/^##/d' -e 's/H|/,H|/g' -e 's/Q|/,,Q|/g' -e '1 i\,,,' sample_1.txt > sample_2.txt I have many lines that start with either: S| T| #D= ## H| Q| The idea is to not copy the lines starting with one of the first fours and to replace H| (at the beginning of lines) by ,H| and Q| (at the beginning of lines) by ,,Q| But now I would need to: use the fastest way possible (internet suggests (m)awk is faster than sed)