replace fscanf with fgets/strtok