Regular expression and read.csv

I have a file list similar to the list below

[1] "M601-M-2020-09.csv"
[2] "M601-M-2020-10-2.csv"
[3] "M601-M-2020-10.csv"
[4] "M601-M-2020-11.csv"
[5] "M601-M-2020-12-1.csv"
[6] "M601-M-2020-12.csv"

I only want to read files 1, 3, 4, 6 (it's about the file name structure).

So far, I have managed to prepare such a solution:

list.files (sciezka, pattern = paste0("^(M601-M-)(", rok, ").*\.csv$") )

list.files (sciezka, pattern = "\\d{2}\\.csv$")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.