def save_as outfile
      _t = "(all rows)"
      if @selected_indices.size > 0
        _t = "(selected rows)"
      end
      unless outfile
        outfile = get_string "Enter file name to save #{_t} as "
        return unless outfile
      end

      # if there is a selection, then write only selected rows
      l = nil
      if @selected_indices.size > 0
        l = []
        @list.each_with_index { |v,i| l << v if @selected_indices.include? i }
      else
        l = @list
      end

      File.open(outfile, 'w') {|f|
        l.each {|r|
          line = r.join "\t"
          f.puts line
        }
      }
    end
def save_as outfile
      _t = "(all rows)"
      if @selected_indices.size > 0
        _t = "(selected rows)"
      end
      unless outfile
        outfile = get_string "Enter file name to save #{_t} as "
        return unless outfile
      end

      # if there is a selection, then write only selected rows
      l = nil
      if @selected_indices.size > 0
        l = []
        @list.each_with_index { |v,i| l << v if @selected_indices.include? i }
      else
        l = @list
      end

      File.open(outfile, 'w') {|f|
        l.each {|r|
          line = r.join "\t"
          f.puts line
        }
      }
    end
save the table as a file
 @param String name of output file. If nil, user is prompted
 Currently, tabs are used as delimiter, but this could be based on input
 separator, or prompted.