I'm more like a caveman when it comes to programming tools. So, with that in mind, is there a way to use readBin in a batch format to read in pieces of a large binary file? Thank you for the consideration of my question. Todd Remund
On 6/18/2007 12:17 PM, Todd Remund wrote:> I'm more like a caveman when it comes to programming tools. So, with that > in mind, is there a way to use readBin in a batch format to read in pieces > of a large binary file? Thank you for the consideration of my question.I'm not sure what you mean by "batch format", but you can use readBin to read bits and pieces of a file, by opening a connection to the file and reading from there. For example, to read a single unsigned byte value at offset 10000, do something like this: con <- file("myfile.dat", open="rb") # open for binary reading seek(con, 10000) result <- readBin(con, "integer", size=1, signed=FALSE) close(con) Duncan Murdoch
Hi Todd Remund wrote:> I'm more like a caveman when it comes to programming tools. So, with that > in mind, is there a way to use readBin in a batch format to read in pieces > of a large binary file? Thank you for the consideration of my question.The 'hexView' package might be useful to you. See "Viewing Binary Files with the hexView Package" in R News 7/1. Paul> Todd Remund > > ______________________________________________ > R-help at stat.math.ethz.ch 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.-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/