reverse & resample input file