I have a file that contains employee numbers alongside the employee name and then the department. It looks like this:
0234569884566781DOE, JOHN K KF ("KF" is the department)
2487231227879636WHITE, ERIC C KF
0234569884566781DOE, JOHN KRT ("RT" is the department. Some do not have a space after the middle initial like the first two examples)
and so on.
I am trying to do a substring where the output is the employees full name i.e. DOE, JOHN K. How would I set up the substring to only get the full name and nothing else?
The starting position will always be 16 because the employee number is always 16 digits. But I am not sure what the end position would be because the name obviously differs in length for each person.
.slice(16, -2).