Extract five digits sequence from a filename with x number of alphanumeric characters followed by the five digit sequence surrounded by a single underscore on either side then another set of x number of alphanumeric characters.
echo 'someletters_12345_moreleters.ext' | cut -d'_' -f 2