#!/usr/bin/ruby -Ku
require 'rubygems'
require 'csv'

f=ARGV[0]
File.open("#{f}") { |content|
  while line=content.gets
    puts CSV.parse(line).map{ |x|
     [ x[0], *x[1..-1].each.with_index.map{ |y, i| "#{i+1}:#{y}"} ].join(' ')
    }.join("\n")
  end                                                                           
}

arrow
arrow
    全站熱搜

    igogo 發表在 痞客邦 留言(0) 人氣()