c code to read a bin map and pass it to txt