We don't bite newbies here... much | |
PerlMonks |
one-line split file sequence checkerby wdef2 (Acolyte) |
on Jan 21, 2008 at 23:27 UTC ( [id://663473]=CUFP: print w/replies, xml ) | Need Help?? |
Identify missing parts in a sequence of split files in the current dir eg file.1, file.03, file.005 etc => prints 2 and 4
I'm sure this could be made tighter, I'm still a Perl newbie.
perl -e 'for $c (sort {$a<=>$b} grep(s/^.+?([0-9]+)$/$1/, `ls *[0-9]`)){ ++$n == $c || print grep(s/$/\n/, $n...$c-1) ; $n=$c }'
Back to
Cool Uses for Perl
|
|