I have a lot of .txt files in a folder that start with the same sequence. They are called FILE-A-123, FILE-A-2817, etc. I want to import all of them into R, and then make an ID row that consists of the name of each file. So the data set would look like:
ID col1 col2
FILE-A-123 3 8
FILE-A-2817 7 1
I have over 100 files so if there is a way to import the whole folder or use a function like "starts_with", that would be great. Any help is appreciated!