pkl_to_txt script