[ytti@ytti ~/usr/git/jobtransform]% time cat inputs2|./jobstransform >/dev/null cat inputs2 0.00s user 0.03s system 0% cpu 3.083 total ./jobstransform > /dev/null 3.04s user 0.21s system 105% cpu 3.092 total [ytti@ytti ~/usr/git/jobtransform]% time cat inputs2 >/dev/null cat inputs2 > /dev/null 0.00s user 0.00s system 68% cpu 0.006 total [ytti@ytti ~/usr/git/jobtransform]% head -n1 inputs2 0,1,15895,2914:390_2914:1007_2914:2000_2914:3000,100,174,129.250.0.167,154.54.11.9,536,241,54.200.0.0,176.8.0.0,15,16,2,213 [ytti@ytti ~/usr/git/jobtransform]% [ytti@ytti ~/usr/git/jobtransform]% cat src/jobstransform.cr class JobTransform def run STDIN.each_line do |line| words = line.split(',') comms_str = words[3].split('_') comms_int = comms_str.map do |comm| comm.split(':').last end puts words[0..2].join('|') + "|[" + comms_int.join(',') + "]|" + words[4..-1].join('|') end end end JobTransform.new.run [ytti@ytti ~/usr/git/jobtransform]%