I have a file with four repeated lines. I am looking to remove the last character of every fourth line. A description of the file is below.
@Header
DNA Sequence
+
Quality score!
<Pattern of four above lines repeats>
I am trying to remove the last character (an exclamation point) from every fourth Quality score line.
@Header
DNA Sequence
+
Quality score
<Pattern of four above lines repeats>
I am able to use awk to pull out every fourth line, but how do I remove the last character in place on every fourth line of the file?
This question operates only on a specific line. Currently my approach is to use awk to pull the Quality score and I can remove the last character with sed.
awk 'NR == 4 || NR % 4 == 0'
sed 's/.$//'
I am currently not sure how to overwrite the edited Quality scores into the original file. Any thoughts or more concise inplace sed / awk arguments would be appreciated.