SHARE
TWEET

rangeselect

a guest Nov 8th, 2014 173 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/awk -f
  2.  
  3. BEGIN {
  4.         gsub(/^|[ \t]+|$/, ",", range)
  5.         if (match(range, /,-[0123456789]+,/))
  6.                 slctd = 1
  7. }
  8.  
  9. range ~ ("," NR "-") {slctd = ! slctd}
  10. (range ~ ("," NR ",") || slctd) && ! (range ~ ("," NR ",") && slctd) {print}
  11. range ~ ("-" NR ",") {slctd = ! slctd}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top