in reply to delete last CR and LF from txt
You're looking for a regex anchored to the end of the first line when using read, reverse, regex, re-reverse and write.