text: user16884: Good afternoon, I'm a bioinformatics student and I'm trying to put some strings between commas with a space. The output looks like this: NC_037078.1:122545-124035,NC_037078.1:96630-98120 and I want it to be like this: NC_037078.1:122545-124035, NC_037078.1:96630-98120 
  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' | sed 's/ /./1' | sed 's/ /-/g' | sed 's/-//1' | tr "\n" ",")
  
  
  user3848: It seems a small change. Anyway try ...
  perl -p -e 's/(.*NC_[0-9]+\.[0-9]),(NC_[0-9]+\.[0-9].*)/$1,\s$2/g' data.txt
  
  If you have happy that this works, then repeat with an -i flag
  perl -p -i -e 's/(.*NC_[0-9]+\.[0-9]),(NC_[0-9]+\.[0-9].*)/$1,\s$2/g' data.txt
  
  I've not checked the code, but it's worth checking whether .* is really needed. Its a while since I've used Perl
  
original_text: 16884: <p>Good afternoon, I'm a bioinformatics student and I'm trying to put some strings between commas with a space. The output looks like this: <code>NC_037078.1:122545-124035,NC_037078.1:96630-98120 </code>and I want it to be like this: <code>NC_037078.1:122545-124035, NC_037078.1:96630-98120 </code></p>
  <p>The document is like this:<br />
  1. rrn16 <br />
  16S ribosomal RNA [Genlisea aurea]<br />
  Other Aliases: C7J69_pgr001, BK572_Gau_0120<br />
  Genomic context: Chloroplast<br />
  Annotation:  NC_037078.1 (122545..124035, complement)<br />
  ID:` 36166080</p>
  <p>The script until now looks like this:</p>
  <pre><code>code=$(ls -l | grep &quot;Annotation&quot; data.txt | cut -d &quot; &quot; -f3,4 | sed 's/[(]/:/g' | sed 's/[)]/ /g' | sed 's/[,]/ /g' | sed 's/[ ]//g' | sed 's/[&quot;.&quot;]/ /g' | sed 's/ /./1' | sed 's/ /-/g' | sed 's/-//1' | tr &quot;\n&quot; &quot;,&quot;)
  </code></pre>
   3848: <p>It seems a small change. Anyway try ...</p>
  <pre><code>perl -p -e 's/(.*NC_[0-9]+\.[0-9]),(NC_[0-9]+\.[0-9].*)/<span class="math-container">$1,\s$</span>2/g' data.txt
  </code></pre>
  <p>If you have happy that this works, then repeat with an <code>-i</code> flag</p>
  <pre><code>perl -p -i -e 's/(.*NC_[0-9]+\.[0-9]),(NC_[0-9]+\.[0-9].*)/<span class="math-container">$1,\s$</span>2/g' data.txt
  </code></pre>
  <p>I've not checked the code, but it's worth checking whether <code>.*</code> is really needed. Its a while since I've used Perl</p>
  