title: Using Ruby to automate a large directory system
body: <p>So I have the following little script to make a file setup for organizing reports that we get.</p>
  
  <pre><code>#This script is to create a file structure for our survey data
  
  require 'fileutils'
  
  f = File.open('CustomerList.txt') or die "Unable to open file..."
  a = f.readlines
  x = 0
  
  while a[x] != nil
  
      Customer = a[x]
      FileUtils.mkdir_p(Customer + "/foo/bar/orders")
      FileUtils.mkdir_p(Customer + "/foo/bar/employees")
      FileUtils.mkdir_p(Customer + "/foo/bar/comments")
      x += 1
  
  end
  </code></pre>
  
  <p>Everything seems to work before the <code>while</code>, but I keep getting:</p>
  
  <pre><code>'mkdir': Invalid argument - Cust001_JohnJacobSmith(JJS) (Errno::EINVAL)
  </code></pre>
  
  <p>Which would be the first line from the <code>CustomerList.txt</code>. Do I need to do something to the array entry to be considered a string? Am I mismatching variable types or something?</p>
  
  <p>Thanks in advance.</p>