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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -