#!/usr/bin/ruby -w

fileName="파일명"
splitSize=60000

begin
    counter=0
    f=nil
    file = File.new(fileName, "r")
    while (line = file.gets)
        if(counter.modulo(splitSize)==0)
          f.close if f != nil
          f=File.open(fileName+".#{counter/splitSize}",'w')
          puts "#{counter}"
        end
        f.write(line)
        counter = counter + 1
      end
      f.close
    file.close
rescue => err
    puts "Exception: #{err}"
    err
end

Posted by stekilove
,