title: Unix - Need to cut a file which has multiple blanks as delimiter - awk or cut?
body: <p>I need to get the records from a text file in Unix. The delimiter is multiple blanks. For example:</p>
  
  <pre><code>2U2133   1239  
  1290fsdsf   3234
  </code></pre>
  
  <p>From this, I need to extract   </p>
  
  <pre><code>1239  
  3234
  </code></pre>
  
  <p>The delimiter for all records will be always 3 blanks.</p>
  
  <p>I need to do this in an unix script(.scr) and write the output to another file or use it as an input to a do-while loop. I tried the below:</p>
  
  <pre><code>while read readline  
  do  
          read_int=`echo "$readline"`  
          cnt_exc=`grep "$read_int" ${Directory path}/file1.txt| wc -l`  
  if [ $cnt_exc -gt 0 ]  
  then  
    int_1=0  
  else  
    int_2=0  
  fi  
  done &lt; awk -F'  ' '{ print $2 }' ${Directoty path}/test_file.txt  
  </code></pre>
  
  <p>test_file.txt is the input file and file1.txt is a lookup file. But the above way is not working and giving me syntax errors near awk -F</p>
  
  <p>I tried writing the output to a file. The following worked in command line:</p>
  
  <pre><code>more test_file.txt | awk -F'   ' '{ print $2 }' &gt; output.txt
  </code></pre>
  
  <p>This is working and writing the records to output.txt in command line. But the same command does not work in the unix script (It is a .scr file)</p>
  
  <p>Please let me know where I am going wrong and how I can resolve this.</p>
  
  <p>Thanks,<br>
  Visakh</p>