0

I am trying to rename the fastq header and add "/1" at the end of fastq header using sed commmand. Here is my code:

sed i '1~4 s/$/\\1/g' seq/*_1.fq

But no change has been made. Does someone know how to solve this? Thanks!

2
  • 1
    Please add sample input (no descriptions, no images, no links) and your desired output for that sample input to your question (no comment). Commented Mar 6, 2021 at 3:43
  • @Christina - if the system lets you, please "upvote" and "accept" Allan Wind's reply. Commented Mar 6, 2021 at 5:34

1 Answer 1

1

This will add /1 to line n * 4 + 1 where n >= 0 for the files matching the glob seq/*_1.fq:

sed -i '1~4s/$/\/1/' seq/*_1.fq

You did not provide any input to here is what I used:

a
b
c
d
e
f

and the result was:

a/1
b
c
d
e/1
f
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.