Skip to content

Instantly share code, notes, and snippets.

@lkptrzk
Created December 8, 2013 16:45
Show Gist options
  • Select an option

  • Save lkptrzk/7860021 to your computer and use it in GitHub Desktop.

Select an option

Save lkptrzk/7860021 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var concat = require('concat-stream')
var target = 0
if (process.argv[2])
target = parseInt(process.argv[2], 10)
process.stdin.pipe(concat(function (input) {
var lines = input.toString().split('\n')
lines.forEach(function (line) {
var parts = line.split(',')
console.log(parts[target])
})
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment