-1
$\begingroup$

I'm trying to alter this string: NC_037078 1:122545 124035 into this: NC_037078.1:122545-124035 but I don´t know how.

The document is like this:\

    1. rrn16 \
16S ribosomal RNA [Genlisea aurea]\
Other Aliases: C7J69_pgr001, BK572_Gau_0120\
Genomic context: Chloroplast\
Annotation:  NC_037078.1 (122545..124035, complement)\
ID:` 36166080

The script until now looks like this:

code=$(ls -l | grep "Annotation" data.txt | cut -d " " -f3,4 | sed 's/[(]/:/g' | sed 's/[)]/ /g' | sed 's/[,]/ /g' | sed 's/[ ]//g' | sed 's/["."]/ /g' )

Can you help me solving this problem?

$\endgroup$

1 Answer 1

1
$\begingroup$

echo NC_037078 1:122545 124035 | sed 's/ /./1' | sed 's/ /:/g'

Note: Reference: https://stackoverflow.com/questions/59047776/sed-replace-only-first-occurrence-then-only-second-occurrence-then-only-third

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.