[R] Dealing with special characters at end of line in file

J C Nash profjcn@@h @ending from gm@il@com
Sat Dec 15 16:31:55 CET 2018

I am trying to fix up some image files (jpg) that have comments in them.
Unfortunately, many have had extra special characters encoded.

rdjpgcom, called from an R script, returns a comment e.g.,

"In  Alvarez Cabral street by no. 105.\\000"

I want to get rid of "\\000", but sub seems
to be giving trouble.

> sub("\\000", "", ctxt)
[1] "In  Alvarez Cabral street by no. 105.\\0"

Anyone know how to resolve this?


More information about the R-help mailing list