I have a csv export of a servicedesk but some of the data enteries (in the column 'Title') have hidden line breaks in them (or so it seems). When opening the csv file in notepad++ or excel some entries cover multiple rows
example:
Number, Title, Date, User
"1","My csv file sucks help!","01-01-1990","Albert"
"2","Sometimes my title
has a hidden linebreak","01-01-1990","Ronald"
"3","Rather annoying bug present, help!", "02-01-1990","Albert"
I have attempted to gsub() \r\n in R but it did not seem to work. Any insight into the problem would be much appreciated.
Solution preferabily easily repeatable with minimal steps. The error occurs in a weekly export.
R or SQL solution would work best.
*edit
The data is correctly loaded into R, even when removig all line breaks using gsub does the export still contain line breaks
data <- read.table(file="rawdata.csv", sep=",")
print(data)
gsub("[\r?\n|\r]", " ", data['V3'])
#data exporteren
write.table(data, file = "result.txt", quote = TRUE, sep = ",")
Even after running this code, the result.txt still contains line breaks.
even
gsub("[^[:alnum:] ]", " ", data["V3"])
does not remove the line breaks