File indexing completed on 2024-11-16 09:02:48
0001
0002
0003
0004
0005
0006
0007
0008 if ARGV.length < 2
0009 $stderr.puts "USAGE: #{$0} [config_file] [num_files]"
0010 exit 2
0011 end
0012 configN = ARGV[0]
0013 num = ARGV[1].to_i
0014
0015 outN = configN + ".truncated"
0016 out = File.open outN, 'w'
0017 cnt = 0
0018
0019 File.readlines(configN).each do |line|
0020 if line.match? /\.root/
0021 unless line.match? /^[
0022 cnt += 1
0023 end
0024 end
0025 out.puts line
0026 break if cnt >= num
0027 end
0028
0029 out.close
0030 system "cat #{outN}"
0031 puts "#{'-'*40}\nwrote #{outN}"