0

I am trying to read a local htm file and used below code

rawHTML <- paste(readLines("HARVANSH CHAWLA.htm"),collapse = "\n")

but its showing below warning messages

Warning messages:
1: In readLines("HARVANSH CHAWLA.htm") :
line 670 appears to contain an embedded nul
2: In readLines("HARVANSH CHAWLA.htm") :
incomplete final line found on 'HARVANSH CHAWLA.htm'

I have attach the file for reference also.

https://1drv.ms/f/s!AgSrwi8NCr0BgxjmFpQ0vOdF6Wpg

Many thanks

PritamJ
  • 337
  • 4
  • 10
  • See this answer: https://stackoverflow.com/questions/23209464/get-embedded-nuls-found-in-input-when-reading-a-csv-using-read-csv The line ending issue also suggests you're working on windows/the file originated from windows. – snaut Jul 27 '17 at 07:11
  • @snaut Thanks. I added shipNul=True to ignore embedded nuls but still getting warning message `rawHTML <- paste(readLines("HARVANSH CHAWLA.htm",skipNul = TRUE),collapse = "\n")` and the warning message is `Warning message: In readLines("HARVANSH CHAWLA.htm", skipNul = TRUE) : incomplete final line found on 'HARVANSH CHAWLA.htm'` – PritamJ Jul 27 '17 at 07:43
  • If you only have to do this for one or two files, just add an empty line at the end of the file manually, if there's more files you might figure something out with `cat` and `append=TRUE` Also see: https://stackoverflow.com/questions/5990654/incomplete-final-line-warning-when-trying-to-read-a-csv-file-into-r – snaut Jul 27 '17 at 08:03

0 Answers0