title: copy paste tab delimited results into excel file
body: <p>I created a script to obtain data from a LDAP database and wrote it to a file with each value in a row separated by tabs. I then tried to copy and paste the contents of that file to excel, but it places all the tab delimited contents of each "column" within a row in the first column for that row, instead of placing each column of data in its own row within the excel file. Rows paste fine. 
  For example lets take this mock first row</p>
  
  <pre><code>12121212 [] lastname,  firstname [] title [] phone [] manager
  </code></pre>
  
  <p>[] = where i tried to programmatically insert a tab in my data output</p>
  
  <p>This puzzles me because I deliberately mad a function that removes the new line from my ldap search result, and adds a tab to the end of the data return for that column.  Here is the addTab function:</p>
  
  <pre><code>function addTab {
      res='           ' # res = "\t\tx"
      echo $1 | tr -d '\n'
      echo "$res" | tr -d '\n'
  </code></pre>
  
  <p>}</p>
  
  <p>This is how I am calling the function (note $i is from the array of UIDs I use to search against via loop iteration):</p>
  
  <pre><code>addTab `getattrVal $i employeeNumber`
  addTab `getattrVal $i employeeType`
  addTab `getattrVal $i ou`
  addTab `getattrVal $i managerEmployeeNumber`
  </code></pre>
  
  <p>And here is the code for the getattrVal function</p>
  
  <pre><code>function getattrVale {
      /opt/bin/ldapsearch -QLLLZZH ldap://${VIP}:389/ -b $1 $2 | grep "$2:" |awk '{ print $2 }'
  </code></pre>
  
  <p>}</p>
  
  <p>I've even tried using the column command to generate nice and even outputted columns (i.e. column -t bashCreatedTabFile.txt) and I still can not paste the contents as desired within the Excel spread sheet.</p>
  
  <p>I realize there are better ways to probably do this, but I think understanding why this is not working is important to my progress. </p>