in your readline() try to replace

resulttemp = result;

with

resulttemp+ = FIELD_SEP+result;