def convert(name = @csv_filename)
      rowIndex     = 0
      excludedCols = []
      defaultCol   = 0

      CSV.foreach(name, :quote_char => '"', :col_sep => @csv_separator, :row_sep => :auto) do |row|

        if rowIndex == 0
          #check there's at least two columns
          return unless row.count > 1
        else
          #skip empty lines (or sections)
          next if row == nil or row[@keys_column].nil?
        end

        # go through columns
        row.size.times do |i|
          next if excludedCols.include? i

          #header
          if rowIndex == 0
            # defaultCol can be the keyValue
            defaultCol = i if self.default_lang == row[i]
            # ignore all headers not listed in langs to create files
            (excludedCols << i and next) unless @langs.has_key?(row[i])

            language = Language.new(row[i])
            if @langs[row[i]].is_a?(Array)
              @langs[row[i]].each do |id|
                language.add_language_id(id.to_s)
              end
            else
              language.add_language_id(@langs[row[i]].to_s)
            end
            @languages[i] = language
          elsif !@state_column || (row[@state_column].nil? || row[@state_column] == '' || !@excluded_states.include?(row[@state_column]))
            key = row[@keys_column]
            comment = @comments_column ? row[@comments_column] : nil
            key.strip! if @stripping
            default_value =  self.default_lang ? row[defaultCol] : nil
            value = self.process_value(row[i], default_value)
            @comments[key] = comment
            @languages[i].add_content_pair(key, value)
          end
        end

        rowIndex += 1
      end

      write_content
    end
def convert(name = @csv_filename)
      rowIndex     = 0
      excludedCols = []
      defaultCol   = 0

      CSV.foreach(name, :quote_char => '"', :col_sep => @csv_separator, :row_sep => :auto) do |row|

        if rowIndex == 0
          #check there's at least two columns
          return unless row.count > 1
        else
          #skip empty lines (or sections)
          next if row == nil or row[@keys_column].nil?
        end

        # go through columns
        row.size.times do |i|
          next if excludedCols.include? i

          #header
          if rowIndex == 0
            # defaultCol can be the keyValue
            defaultCol = i if self.default_lang == row[i]
            # ignore all headers not listed in langs to create files
            (excludedCols << i and next) unless @langs.has_key?(row[i])

            language = Language.new(row[i])
            if @langs[row[i]].is_a?(Array)
              @langs[row[i]].each do |id|
                language.add_language_id(id.to_s)
              end
            else
              language.add_language_id(@langs[row[i]].to_s)
            end
            @languages[i] = language
          elsif !@state_column || (row[@state_column].nil? || row[@state_column] == '' || !@excluded_states.include?(row[@state_column]))
            key = row[@keys_column]
            comment = @comments_column ? row[@comments_column] : nil
            key.strip! if @stripping
            default_value =  self.default_lang ? row[defaultCol] : nil
            value = self.process_value(row[i], default_value)
            @comments[key] = comment
            @languages[i].add_content_pair(key, value)
          end
        end

        rowIndex += 1
      end

      write_content
    end
Convert csv file to multiple Localizable.strings files for each column