title: Pig how to format a semi-structured CSV with filters
body: <p>I have semi-structured CSV , which looks something like this.  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>VTS,01,0099,7022606164,SP,GP,33,060646,A,1258.9805,N,07735.9303,E,0.0,278.6,280515,0000,00,4000,11,999,842,4B61
  VTS,01,0099,7022606164,NM,GP,20,060637,A,1258.9805,N,07735.9302,E,0.0,278.6,280515,0000,00,4000,11,999,841,7407+++
  VTS,66,0065,7022606164,NM,0,GP,22,060648,280515,1258.9804,N,07735.9301,E,04AE+++
  VTS,01,0099,7022606164,NM,GP,22,060656,A,1258.9804,N,07735.9301,E,0.0,278.6,280515,0000,00,4000,11,999,843,8FEB+++
  VTS,01,0099,7022606164,NM,GP,22,060721,A,1258.9803,N,07735.9304,E,0.0,278.6,280515,0000,00,4000,11,999,845,044D++++++
  VTS,99,0065,7022606164,NM,0,A,GP,22,060648,280515,1258.9804,N,07735.9301,E,04AE+++
  VTS,99,0065,7022606164,NM,0,A,GP,22,060648,280515,1258.9804,N,07735.9301,E,04AE</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to make make three different tables with this data. i.e. one with VTS,01 another with VTS,99 and another with VTS,66. Again I also need to remove the "+++" attached with each line as its an error, for which I have written this pig script.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>data = load '/user/simulator/SKYTRACK/27thMay2015' using PigStorage('\n') as (f1:chararray);
  splt = foreach data generate FLATTEN(STRSPLIT($0, '\\+++'));
  data_pkt = FILTER splt BY $0 MATCHES '.*VTS,01+.*';
  sos_pkt = FILTER splt BY $1 MATCHES '.*VTS,99+.*';
  health_pkt = FILTER splt BY $2 MATCHES '.*VTS,66+.*';</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I am testing this scripts individually for each of the table only one output I receive the rest with no output,</p>
  
  <p><code>dump data_pkt;
  dump sos_pkt;
  dump health_pkt;</code></p>
  
  <p>I am very much new to pig so can anyone help me to solve this issue..It will be deeply appreciated.</p>