Re: [R] Scan document including "\n"

From: Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>
Date: Tue, 17 Jun 2008 13:11:24 -0400

Hi there,

Try this:

your.file=read.table(textConnection("<XML>

<TAG>
</TAG>
</XML>"),header=FALSE)

paste(your.file$V1,"\n",collapse="",sep="") [1] "<XML>\n<TAG>\n</TAG>\n</XML>\n"

HTH, Jorge

On Tue, Jun 17, 2008 at 1:01 PM, ppatel3026 <pratik.patel_at_us.rothschild.com> wrote:

>
> How do you read in a whole file while preserving end of line "\n"
> characters?
> Basically, read in a whole file as one string.
>
> Ex:
> <XML>
> <TAG>
> </TAG>
> </XML>
>
> After this file is read into a variable, it should really look like
> "<XML>\n<TAG>\n</TAG>\n</XML>\n"
>
>
> --
> View this message in context:
> http://www.nabble.com/Scan-document-including-%22%5Cn%22-tp17920810p17920810.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 17 Jun 2008 - 17:29:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 17 Jun 2008 - 17:30:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive