Is this not already happening? it should be a column named "file_name" containing the name of the datasets, could you share a sample of the output? head(df)
This thread is already solved, but I'd like to add to Andres answer that in case you want to assign the file contents to separate data.frame's, you can use the assign function. Then, you'll use something like following:
# listing files
xlsx_file_lists <- list.files(pattern = ".xlsx") # if files are in working directory, otherwise add path
# looping and assigning
for (counter in xlsx_file_lists)
{
assign(x = strsplit(x = counter,
split = "[-.]")[[1]][3], # for the pattern in your filenames
value = readxl::read_xlsx(file = counter))
}