I don't get to play with one-liner obfu/golf too often, so thought I'd try this question :) Prints an empty line in between any missing numbers.
perl -le 'for(<>){/(.*?)(\d+)/;$h{$2}=$1;$a=$2if$2>$a;}for(1..$a){print$h{$_}||""}' c.txtInput:
today 5 tomorrow 3 but not as 2 anything can 11 what the hell 4 I don't know 6 I'm outta here! 10
In reply to Re: Print to specific line
by stevieb
in thread Print to specific line
by perlUser345
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |