title: How can I search a particular column in Perl?
body: <p>I have a text file which contains some data. I am trying to search for EA  in  <strong>ID column only</strong> and prints the whole row. But the code recognize all EA and prints all rows. What  code I should add to satisfy the condition? Thanks Again:-)!</p>
  
  <p>DATA: <br>
  Name Age ID <br>
  ---------------------<br>
  KRISTE,22,<strong>EA</strong>2008<br>
  J<strong>EA</strong>N,21,ES4567<br>
  JAK,45,<strong>EA</strong>2008<br><br>
  The code prints:<br>
  KRISTE,22,<strong>EA</strong>2008<br>
  J<strong>EA</strong>N,21,ES4567<br>
  JAK,45,<strong>EA</strong>2008<br></p>
  
  <p>Desired output:<br>
  KRIS,22,<strong>EA</strong>2008<br>
  Kane,45,<strong>EA</strong>2008,<br></p>
  
  <pre><code>file='save.txt';
  open(F,$file)||die("Could not open $file");
  while ($line=&lt;F&gt;){
  if ($line=~ m/$EA/i) {
  my @cells=($f1,$f2,$f3)= split ',',$line;
  print "&lt;TD&gt;f1&lt;/TD&gt;";
  print "&lt;TD&gt;f2&lt;/TD&gt;";
  print "&lt;TD&gt;f3&lt;/TD&gt;";
  }
  </code></pre>