lib/sycsvpro/transposer.rb
def execute
      transpose = {}

      File.open(@infile).each_with_index do |line, index|
        line = unstring(line)
        next if line.empty?

        result = @col_filter.process(@row_filter.process(line, row: index))
        next if result.nil?

        result.split(';').each_with_index do |col, index|
          transpose[index] ||= []
          transpose[index] << col
        end
      end

      File.open(@outfile, 'w') do |out|
        transpose.values.each { |value| out.puts value.join(';') }
      end
    end
def execute
      transpose = {}

      File.open(@infile).each_with_index do |line, index|
        line = unstring(line)
        next if line.empty?

        result = @col_filter.process(@row_filter.process(line, row: index))
        next if result.nil?

        result.split(';').each_with_index do |col, index|
          transpose[index] ||= []
          transpose[index] << col
        end
      end

      File.open(@outfile, 'w') do |out|
        transpose.values.each { |value| out.puts value.join(';') }
      end
    end
def execute transpose = { } File . open ( @infile ) . each_with_index do | line , index | line = unstring ( line ) next if line . empty? result = @col_filter . process ( @row_filter . process ( line , row : index ) ) next if result . nil? result . split ( ';' ) . each_with_index do | col , index | transpose [ index ] ||= [ ] transpose [ index ] << col end end File . open ( @outfile , 'w' ) do | out | transpose . values . each { | value | out . puts value . join ( ';' ) } end end
Create a new Transpose
   Sycsvpro::Transpose(infile:  "infile.csv",
                       outfile: "outfile.csv",
                       rows:    "0,3-5",
                       cols:    "1,3").execute
 Executes the transpose by reading the infile and writing the result to
 the outfile
Create a new Transpose Sycsvpro :: Transpose ( infile : infile . csv outfile : outfile . csv rows : 0 3 - 5 cols : 1 3 ) . execute Executes the transpose by reading the infile and writing the result to the outfile