make readtxt2 work with pipes