If you're okay with gawk, most implementations ship with gawkextlib, which has readfile(), and you also have FIELDWIDTHS.