title: FInd similar patterns in a row using Awk or SED
body: <p>Need some help here
  I have file which has multiple rows, Something like below</p>
  
  <pre><code>'**FSR**+S:KSSSSS+20+14++20120401'FST+S:KSSSSS+2'**FSR**+S:KSSSSS+44+1++20160218'
  '**FSR**+S:KSSSSS+20+14++20120401'FST+S:KSSSSS+2'**FSR**+S:KSSSSS+44+1++20160218'
  '**FSR**+S:KSSSSS+20+14++20120401'FST+S:KSSSSS+2'**FSR**+S:KSSSSS+44+1++20160218'
  '**FSR**+S:KSSSSS+20+14++20120401'
  </code></pre>
  
  <p>I am trying to get all the segments within a row which begins with <strong>FSR</strong>
  so results should be something like this, add pipe every time its finds a FSR, since they are constant on where they would occur in row. so i am not able to use cut here, in short FSR may come in beginning , middle or in the end of the row</p>
  
  <pre><code>'**FSR**+S:KSSSSS+20+14++20120401' | **FSR**+S:KSSSSS+44+1++20160218'
  '**FSR**+S:KSSSSS+20+14++20120401' | **FSR**+S:KSSSSS+44+1++20160218'
  '**FSR**+S:KSSSSS+20+14++20120401' | **FSR**+S:KSSSSS+44+1++20160218'
  '**FSR**+S:KSSSSS+20+14++20120401' 
  </code></pre>
  
  <p>Additionally, this is the code, i had written in perl, thinking if this could be could be done in simple way</p>
  
  <p>#!/usr/bin/perl</p>
  
  <pre><code>use strict;
  use Data::Dumper;
  
  my $filename = $ARGV[0];
  chomp($filename);
  
  open(FILE,$filename);
  my ($FSR);
  
  while(my $data = &lt;FILE&gt;) {
          #print $data;
          ($FSR) = "";
          if($data =~ /('FSR.*?)(.*?)(\')/) {
                  $FSR = "$1,$2";
          }
  print "$FSR\n";
  }
   close(FILE);
  </code></pre>
  
  <p>Please help</p>
  
  <p>Thanks
  Sandy</p>