Sha256: eddb871db7fd6a3fe42b91cff866e04674feccc4a14a9ba2cc57f2ef3337789f

Contents?: true

Size: 356 Bytes

Versions: 26

Compression:

Stored size: 356 Bytes

Contents

#!/usr/bin/env ruby

target = ARGV[1].to_i

map = {}

STDIN.each_line do |line|
  chunks = line.split(" ")
  next unless chunks[target]
  map[chunks[target]] ||= []
  map[chunks[target]].push(line)
end

map.each do |identifier, lines|
  File.open("group_#{identifier}.log", 'a+') do |file|
    lines.each do |line|
      file.puts(line)
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ix-cli-0.0.6 bin/ix-group
ix-cli-0.0.5 bin/ix-group
ix-cli-0.0.4 bin/ix-group
ix-cli-0.0.3 bin/ix-group
ix-cli-0.0.2 bin/ix-group
ix-cli-0.0.1 bin/ix-group