title: Awk not working in bash script
body: <p>I am facing a perplexing (at least for me) problem. I'm trying to read some csv files and then extract some values to make some checking and calculus. I'm using awk to access files and extract required fields.</p>
  
  <p>The strange point is that the awk sentence properly runs on a bash prompt but it does not work when run in the script. As an example I get from bash prompt: </p>
  
  <pre><code>paco@NIMBUS:~/work$ awk -F\; '$1 == "21-08-2012" &amp;&amp; $2 == "'17'" { print $3 }' niveles-rams.csv
  2
  </code></pre>
  
  <p>but </p>
  
  <pre><code>nrams1=`awk -F\; '$1 == "'$fecha'" &amp;&amp; $2 == "'$area'" { print $3 }' niveles-rams.csv`
  echo $nrams1
  </code></pre>
  
  <p>does not return any value. CSV files come from an Excel in windows so maybe there could be a problem with encoding, I guess?</p>
  
  <p>You can find the script validacio.bash and csv files in the following URL</p>
  
  <ul>
  <li><a href="http://ubuntuone.com/5b0vTvZ82B5a9GfqaplxbT" rel="nofollow">niveles-rams.csv</a></li>
  <li><a href="http://ubuntuone.com/3B94FmzzgKS7DdM4l4acBr" rel="nofollow">pobles.csv</a></li>
  <li><p><a href="http://ubuntuone.com/02FVmuWK2jc8bqNwCxc1XE" rel="nofollow">umbrales.csv</a></p></li>
  <li><p><a href="http://ubuntuone.com/3RuSyLSQGa4svsqEbzaaow" rel="nofollow">validacio.bash</a></p></li>
  </ul>
  
  <p>Thanks for your help and patience</p>