data.table::fread(c:/"1 Year.csv") started to give error due to space after number in filename

Hi

> data.table::fread("c:/1 Year.csv")

now gives error:

'C:\Rlib\Data\1' is not recognized as an internal or external command,
operable program or batch file

So the number at the start of the files name followed by a space causes the fail. Is there a fix please?

I thought this exact code worked earlier this week but now it generates this error.

RDSK

Try:
data.table::fread("c:/1 Year.csv")

1 Like

Sorry for typo (now corrected) but the problem is shown in the error message itself

'C:\Rlib\Data\1' is not recognized as an internal or external command,
operable program or batch file

The fread function is assuming the filename is "1" due to the space following.

I think there must be a hidden character problem of some sort.

When I use the new functionality in R to select the file by hitting tab within "" makrs it works again.

A puzzle!

I tried it locally without a problem, so possibly a hidden character as you say.

data.table::fread(file = "c:/1 Year.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.