example for readFile with function of readline