I am doing a text analysis with R and needed to convert the first letters of the sentences into lowercase while keeping the other capitalized words the way they are. So I used the command
x <- gsub("(\\..*?[A-Z])", '\\L\\1', x, perl=TRUE)
which worked, but partially. The problem is that for the text analysis I had to convert the pdf files into txt format and now the txt files contain a lot of empty lines (page breaks, returns possibly), and therefore the command I used does not convert the capital letters that appear on the new lines. I was trying to eliminate the empty lines using different combinations in gsub with multiple \s, with \r, \n but nothing works. When I do the inspect(x) of the tm-package, the output looks in the following way:
[346]
[347] Thank you.
[348]
[349] Vice President of Investor Relations
[350]
I would be grateful if anyone could help me!