Without seeing your csv files, it is difficult to determine the best answer. Perhaps try reading in one file first using fread. Using something like this may work:
dat <- fread("grep -v ENDOFFILEMARKER filename.csv")
where filename.csv is the name of one of your files placed in your working directory. The -v makes grep return all lines except lines containing the string ENDOFFILEMARKER. If you can get it working with one file, you can then work on applying similar logic to all of the files using lapply.
Another option which has worked for me is using the readLines function. The downside is that the readLines function is somewhat slow. But, if you can't figure out another way, then readLines will work. Here's basically how I used it on one file:
length_a <- length(readLines("filename.csv"))
dt <- fread("filename.csv", nrows = length_a-1)
Once you have it working for one file, you can then figure out how to use it with a loop for all your files.
I understand that fread("head -n -1 filename.csv")
is the generally accepted method of skipping the last line but I have never been able to get it to work properly.
Edit: If you are using Windows, this may work for you:
dat <- fread('findstr /V /C:"ENDOFFILEMARKER" filename.csv')
grep works well if you are using Linux or have Linux tools installed on your Windows machine. If you are using Windows, findstr command is similar to the grep command in Linux. The /V returns all lines except the line containing ENDOFFILEMARKER. The /C:"... ..." allows for matching multiple words including spaces or just one word exactly.