Added ability to select by id/name and write data to file.