reads a file and dumps into another