CSV record cannot be read

I have problems reading my CSV record into RStudio: Afterconducting a survey on Sosci Survey, I downloaded the record and wanted to read it into R with the "read. csv"

function. However, I get the error message:
“Warning in read. table (file = file, header = header, sep = sep, quote = quote,:
line 1 appears to contain embedded nulls
Warning in read. table (file = file, header = header, sep = sep, quote = quote,:”

which is repeated for all lines

The record appears in my environment, but instead of 241 obs in 25 variables I get 241 in 1 variable output. When I open it, all values are also marked as NA.

Afterwards I tried to use "read. csv2" because I thought that R might not read the separator characters and therefore the problems occur, but then I get a dataset with 0 obs of 1 variable in my environment and the same error message.

Since I don’t know what the cause of the error is, I would really appreciate your help!

can you validate that the csv was properly created, perhaps by opening it in a conventional spreadsheet application and seeing that it looks normal ?

Aside from that, given your error message about embedded nulls, try the skipNul param (make it equal TRUE)

Thank you for your message!
Yes I've opened it in Excel and for me it looks completely normal, seperated columns etc.
So I'd tried the skipNul and it changed something, but unfortunatly it all stayed in one column.

Do you know exactly what the separator is? Is it a comma?

I would use readLines on the file with n=2
to get a look at the raw content.
Perhaps do that and share some of it here

So I downloaded it again and saw that the setting was set as "Tab" for the seperator. When I changed it to comma and ran the read.csv again with skipNul it worked out! Thank you so much for your help!

1 Like

This topic was automatically closed 7 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.