From e0b634754d1bef33dc8e72509c6990cccc32745a Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Thu, 9 Oct 2014 20:47:23 +0100 Subject: alles neu macht der mai --- split_pipes | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 split_pipes (limited to 'split_pipes') diff --git a/split_pipes b/split_pipes new file mode 100755 index 0000000..eeba69b --- /dev/null +++ b/split_pipes @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby + +require 'trollop' + +STDIN.set_encoding 'utf-8' +STDOUT.set_encoding 'utf-8' + +cfg = Trollop::options do + banner "splitpipes -f < " + opt :field, "field", :type => :int +end + +while line = STDIN.gets + j = 1 + line.strip.split(' ||| ').each { |i| + if j == cfg[:field] + puts i.strip + break + end + j += 1 + } +end + -- cgit v1.2.3