ファイルの行数数えて比較

count_max = Array.new

#ファイルを開いて行数を配列に追加
File.open(cybozu) { |file|
nil while file.gets
count_max << file.lineno
}

#ファイルを開いて行数を配列に追加
File.open(lv_moto) { |file|
nil while file.gets
count_max << file.lineno
}

#配列の中から大きい方をcount_motoに追加
count_moto = count_max.max


Tags:

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes