Reading from CHEN type and writing to subdirectory