I have a regex question.
I have a list of files below.
df <- c("Alilis CELF-4_CF_Data_Entry.xlsx" , "Ana T. CELF-4_CF_Data_Entry.xlsx" , "Ana V. CELF-4_CF_Data_Entry.xlsx","Anita CELF-4_CF_Data_Entry.xlsx")
[1] "Alilis CELF-4_CF_Data_Entry.xlsx" "Ana T. CELF-4_CF_Data_Entry.xlsx" "Ana V. CELF-4_CF_Data_Entry.xlsx" "Anita CELF-4_CF_Data_Entry.xlsx"
I need to extract the name at the beginning of the string but there are a short letter with dot (e.g. Ana V.) I was not able to extract the letters.
With the code below,
unique(word(df, 1))
[1] "Alilis" "Ana" "Anita"
How can I get ?
[1] "Alilis" "Ana T." "Ana V." "Anita"