title: Read a csv file from a bash scripting file
body: <p>in a folder, I have 2 files. Valuation.csv and another file myScript.sh </p>
  
  <p>My CSV file has 10 lines and 5 columns. I have tried to read it multiple times but it never worked. This is what I have tried as code inside my myScript.sh:</p>
  
  <p>First try:</p>
  
  <pre><code>#!/bin/bash
  
      while read -r line do
          field1=$(echo $line | awk -F'|' '{printf "%s", $1}' | tr -d '"')
          field2=$(echo $line | awk -F'|' '{printf "%s", $2}' | tr -d '"')
  
          echo $field1 $field2 done &lt; $Valuation.csv
  </code></pre>
  
  <p>Result: /myScript.sh: line 10: .csv: No such file or directory</p>
  
  <p>Second try:</p>
  
  <pre><code>cat Valuation.csv|while read line   do
  read -d, col1 col2 &lt; &lt;(echo $line)
  echo "I got:$col1|$col2"   done
  </code></pre>
  
  <p>Result: nothing </p>
  
  <p>I am running the file like this:</p>
  
  <p>./myScript.sh </p>
  
  <p>thank you</p>
  
  <p><a href="https://i.stack.imgur.com/UqLRY.png" rel="nofollow noreferrer">Here the csv file opened with excel</a></p>