Skip to content

Instantly share code, notes, and snippets.

@igponce
Created May 14, 2015 14:37
Show Gist options
  • Save igponce/ab736de8e68c12cd3c9a to your computer and use it in GitHub Desktop.
Save igponce/ab736de8e68c12cd3c9a to your computer and use it in GitHub Desktop.
Remove TSV column data with regex
#!/usr/bin/env ruby
ARGF.each_line do |ll|
campos = ll.split "\t" # Separamos por tabuladores
campos[3].slice! /[\_\-](Multilink|Po|Gi)?[0-9_-]+(\.[0-9]+)?/
puts campos.join "\t"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment