Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Write out file using ASCII separators?

I’m trying to recreate an existing C# process in R. I’ve got it mostly done but I’m getting hung up on one step: the current process saves the output in text files using ASCII unit and record separators, for example:

enter image description here

I know how to write out data frames, but the ASCII separators are a new twist for me. Is there a way to do this using write_lines or a similar function? Thanks!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It looks like there are unit separators between fields and record separators between records. You can create such output by specifying the characters with their hex literal values. For example

write.table(iris, "iris.txt", sep="\x1f", eol="\x1e")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading