similar to: How I can read the binary file with "different type"?

Displaying 20 results from an estimated 4000 matches similar to: "How I can read the binary file with "different type"?"

2009 May 18
2
readBin on binary non-blocking connections (Windows & Unix differences/bugs)
R-devel: I am encountering a consistency issue using socketConnection and readBin with *non-blocking* connections on Unix and Windows XP (no Vista to test). I am a bit confused by the behavior of *non-blocking* connections under Windows specifically. When calling readBin on a non-blocking connection when there is no data to read on the socket, the connection under Unix will return a vector of
2004 Jun 01
2
Importing binary data
Hi everybody! I've a large dataset, about 2 Mio entries of the format which I would like to import into a frame: <integer><integer><float><string><float><string><string> Because to the huge data amount I've choosen a binary format instead of a text format when exporting from Matlab. My import function is attached below. It works fine for only
2006 Nov 07
1
reading VERY large binary files
Hello, I am trying to read in elements out of a very large binary file ... the total file is 4 gigs. I want to select rows out of the file, and the current procedure I run works but is prohibitively slow (takes more than a day to run and still won't complete). Is there any faster way to accomplish this? My current procedure looks like this: readHH <- function(file_name,
2009 Nov 25
3
Test Binary File
I've got an error with the way I'm using readBin on a binary file of unknown internal structure. I know the structure consists of rows and columns, but I'm not sure how many of each. So, does anyone know of a valid test set of binary data that I could reference while trying to figure out the technique of using readBin? It would be really helpful to try out readBin on a readily
2012 Apr 13
2
Can't read a binary file
Hi, I've read up on readBin() and chapter 6 in the R Data Import/Export manual, but I still can't read a binary file. Here is how the creator of the file described the code that would be needed in Fortran: "Every record has a return in fortran. The length of each record is nx*ny*4. To read you would use the following: nlayx = nx*ny*4 do iz=1,nz,4 read(binary file) var(1:nlayx)
2012 Jun 19
1
seek(), skip by bits (not by bytes) in binary file
Hello, Has a function been built that will skip to a certain bit in a binary file? As of 2009 the answer was 'no': http://r.789695.n4.nabble.com/read-binary-file-seek-td900847.html https://stat.ethz.ch/pipermail/r-help/2009-May/199819.html If you feel I don't need to (like in the links above), please provide some help. (Note this is my first time working with binary files.) I'm
2009 Feb 11
1
Reading Binary Files
Hello I'm encountering some difficulty correctly reading binary files. The binary files store data as "short" rather than "double" , "int", or any of the other modes of the vector being read. The data represents a regular grid of size 419 rows by 264 columns, to make it more interesting, the data are daily records, for a total of 37 years. The file size is
2010 Mar 25
1
RODBC : reading binary data from a TXT field belonging to a PostgeSQL table
Dear R-List, I am working with binary data that I want to store in a PostgreSQL DataBase. I decided to use a TXT field. I read my binary file with readBin function, I succeed in my data storage in the database but I have some trouble to extract the data : the correct amount of bytes is stored in the TXT field but when I access to the data, the extracted dataframe is truncated !
2002 Jun 18
3
Maybe a problem in binary read/write (PR#1688)
Full_Name: Johnny Accot Version: 1.5.1 OS: Linux Submission from: (NULL) (198.4.83.52) Hi. I'm having a problem with the binary read/write functions. I'm writing a device driver in R (why not?) and of course I have to send a couple commands to the device. Typically, I send one byte, receive one acknowledgement byte, send another byte, receive an ACK, and so on. At least this is what
2013 Mar 04
1
How to loop several binary files from two directories?
I have two binary files(rasters) with the same dimensions. The first file is called `over` and the second is `corr`. I want to replace values in `over` by `NA` whenever `corr` is greater than 0.5. to read the two files we can use: conne <- file("C:corr.bin","rb") over <- readBin(conne, numeric(), size=4, n=1440*720, signed=TRUE) frf <-
2009 Dec 17
1
Problem reading binaries created with fortran (More infos)
The structure of the file is clear (see below) the first line is made of integers and doubles with the fifth being a text string followed by arrays of double precision number.: int1 int2 double1 double2 text int3 int4 int5 (array of double) here is an example of file: 1 1 1.0 1.0 "HEAD" 160 224 3 23.4 34.5 ...... I tried to read the first line with readBin (results are copied below):
2007 Jun 18
2
Large Binary file reader for Simple minds
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
2012 Feb 15
1
Using readBin to read binary "unformatted" output files from Fortran?
Hello, I'm wondering if I can get some help with reading Fortran binary "unformatted" output files into R. The Fortran output files were generated in Ubuntu 10.04 LTS using gfortran4.4, on a 32bit Intel Core 2 Duo 3.16 GHz machine, with little-endian and record marker lengths equal to 4. The machine I'm currently trying to read this Fortran output file is a Macbook Pro
2012 Jun 12
1
Reading binary files
Hey guys, I am currently trying to read in a binary file using this helpful manual: http://www.ats.ucla.edu/stat/r/faq/read_binary.htm Reading binary files I also have the detailed format description from the developer. But somehow the reading of the file does still not work properly. The first entry in the file is the following, according to the manufacturer: "String containing 4 one-byte
2004 Mar 10
1
reading binary file with different modes
I have a binary file representing a matrix with columns of different variable type/mode (i.e. the file was saved from C using double and int variables) I want to import it into R, I've been reading the R Import/Export and I am able to use readBin for a file that contains only one variable type (either all doubles or all ints) but I can not find the way to use it when you have a file with
2001 Feb 15
2
Reading single precision floats from binary file
Dear all, I have a few files with binary data written by a C program a friend wrote. I allready have program to read these files, Thomas Lumley and Prof Brian D Ripley was kind enough to respond to a question to this list earlier with some code that works perfectly, so this is really no problem, it is more out curiousity. Most of my files consists of 40000 single precision floats, and I figured
2006 Jun 28
2
read file with readBin (the file was saved with a C-routine)
Hello! I have problems with using of "readBin" to read files, which was written in C with "fwrite". In the C-File there is the following Code: fwrite(MyitINI,sizeof(itINItype),1,outfile); where MyitINI is a structure of the following form typedef struct{ int KernelFileSave; /* Determined, if Systemmatrix saved or not.*/ char KernelFileName[200]; /* A-Matrix name
2009 Jun 24
1
Reading 4-byte float into R from binary file
A simple question, I hope.... I have a binary file format that I want to slurp into R using readBin. There are a couple of fields in the file that are 4-byte floats. Since R has no "float" data type (4-byte), I am wondering how to go about this task. I could simply do all the work in C, but the format is pretty simple, so I wanted to do it using just R. I did see as.single, but it
2008 Aug 21
2
skipping values when reading binary files
Hi, I would like to skip a preset number of values when reading in a binary file (readBin). Is there any way to do this? kind regards, and thanks in advance for the help. Pieter Beck [[alternative HTML version deleted]]
2009 Jul 27
1
read binary file seek()
I want to read in a binary file using the readBin() function. In order to skip uninformative parts of the file I use the seek() function, I need to specify the number of bits to skip rather than the number of bytes to skip. E.g. seek(to.read,origin="current",blockSize) with blockSize giving the number of bits Does anybody know if this works? Any help would be highly