r - Prevent scan() from removing quotations or quotes -
i have folder full of xml files powerpoint content this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
i hoping scan files , replace 1 of these items stringr , cat() file:
a <- scan(file="slide10.xml.rels",what = "raw",sep = "@") b <- str_replace_all(a,pattern = "1.0",replacement = "2.0") cat(b,file="testcat.xml.rels")
the problem is, everytime scan contents of file r, of quotation marks dissapear , lines like:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
turn into:
<?xml version=1.0 encoding=utf-8 standalone=yes?>
which breaks xml file. can scan() or have start using xml reader?
thanks.
Comments
Post a Comment