1 year ago
#362854
Andrea
Getting Error while trying to read .csv in R Studio
I'm trying to import a dataset with .csv format but I keep getting errors.
If I use the built-in import feature of R Studio I get this error:
embedded nul in the string: 'C\0a\0m\0p\0a\0g\0n\0e\0_\0N\0o\0C\0a\0g\0g\0i\0o\0_\0C\0o\0s\0t\0o\0>\00'*
If I use:
google_raw <- read.csv("google_raw.csv")
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 1 appears to contain embedded nulls
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 2 appears to contain embedded nulls
3: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 3 appears to contain embedded nulls
4: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 4 appears to contain embedded nulls
5: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 5 appears to contain embedded nulls
6: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
embedded nul(s) found in input
But if I open the same file with Excel and save it as .XLSX and then try to import it's working fine
Is there a way to convert the .csv file to .xlsx without opening?
Ideally I want to download the file and run a script without the manual action of converting it and then run a script
r
read.csv
r-xlsx
0 Answers
Your Answer