output_width=30 # Adjust this to get sensible output
while read value
do
printf "%${output_width}s\n" "${value}"
done < input_file | sort -nk 1.$[output_width-1] | tr -d " "
This forces it all to 30 (configurable at the top) characters wide (or numeric with %${output_width}d if you prefer) and then sorts on that. At the end in green, I have taken the liberty to strip the blanks out.
All in a single perl code: extraction of rightmost 2 digits, omit any containing lines greater than 33, numerically sort left-over lines based on right-most 2 characters:
#!/usr/bin/env perl
# @(#) p1 Demonstrate filtering, collecting, ordering.
use strict;
use warnings;
my (@a);
while (<>) { # Eliminate numbers ending in > 33, collect rest
chomp;
next if substr( $_, -2, 2 ) > 33;
push( @a, $_ );
}
# Sort numerically by right-most 2 digits
print join( "\n", sort { substr( $a, -2, 2 ) <=> substr( $b, -2, 2 ) } @a ),
"\n";
exit(0);