similar to: handling nulls while reading mainframe file

Displaying 20 results from an estimated 2000 matches similar to: "handling nulls while reading mainframe file"

2002 Apr 26
4
Memory "leak" in readChar (PR#1483)
Full_Name: Hugh C. Pumphrey Version: 1.4.1 OS: Linux (Debian Woody) Submission from: (NULL) (129.215.133.170) The function readChar() appears to have some type of problem with memory allocation. I don't know if "memory leak" is the correct term but if one uses readChar() many times, the R binary grows in size until it eats all your memory and swap space. The code enclosed below
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,
2003 Nov 14
2
writeChar potential buffer overrun (PR#5090)
Trying to copy the (binary) header of a input file directly to an output file, I've had repeatable seg faults. The call: writeChar(hdr, outfh, nchars=6144) when hdr just contains one empty string seems to be the culprit. The stack traces weren't all that illuminating, with sig 11 in memory-related functions following this. But in src/main/connections.c it looks like do_writechar
2024 Jan 26
1
[External] readChar() could read the whole file by default?
On Fri, 26 Jan 2024, Michael Chirico wrote: > I am curious why readLines() has a default (n=-1L) to read the full > file while readChar() has no default for nchars= (i.e., readChar(file) > is an error). Is there a technical reason for this? > > I often[1] see code like paste(readLines(f), collapse="\n") which > would be better served by readChar(), especially given
2024 Jan 29
1
[External] readChar() could read the whole file by default?
My opinion is that the proposed feature would be greatly appreciated by users. I had always wondered if I was the only one doing paste(readLines(f), collapse="\n") all the time. It would be great to have the proposed, more straightforward way to read the whole file as a string: readChar("my_file.txt", -1) or even better readChar("my_file.txt") Thanks for your detailed
2024 Jan 26
1
readChar() could read the whole file by default?
I am curious why readLines() has a default (n=-1L) to read the full file while readChar() has no default for nchars= (i.e., readChar(file) is an error). Is there a technical reason for this? I often[1] see code like paste(readLines(f), collapse="\n") which would be better served by readChar(), especially given issues with the global string cache I've come across[2]. But lacking the
2002 Nov 29
2
readBin or writeBin adds extra nulls (PR#2333)
Full_Name: Ken Yap Version: 1.6.1 OS: Linux (SuSE 8.0) Submission from: (NULL) (129.78.64.5) I'm trying to copy a file using readBin and writeBin. (The reason is to be able to pipe PostScript or PDF output to a socket later, this is just an experiment.) I do: zz <- file("foo.ps", "rb") r <- readBin(zz, character(), 1000000) yy <- file("bar.ps",
2006 Jun 02
1
Typo fix for readBin.Rd
Hi, The man page for readBin has a small typo: --- a/src/library/base/man/readBin.Rd +++ b/src/library/base/man/readBin.Rd @@ -58,7 +58,7 @@ writeBin(object, con, size = NA, endian \code{readBin} and \code{writeBin} read and write C-style zero-terminated character strings. Input strings are limited to 10000 - characters. \code{\link{readChar}} and \code{\code{writeChar}} +
2006 Apr 27
1
Error in readChar(): invalid UTF-8 input
I have R code to read a binary header file, consisting of several readBin() and readChar() statements. I am currently using version R-2.2.1 (on x86_64, RH EL4) and have received the following error Error in readChar(fid, n = 1) : invalid UTF-8 input in readChar() This is strange because (a) I was able to read in this file successfully in previous versions of R (circa 2005) and (b) it
2012 May 03
2
Help with readBin
I'm trying to read a binary file created by a fortran code using readBin and readChar. Everything reads fine (integers and strings) except for double precision numbers, they are read as huge or very small number (1E-250,...). I tried various endianness, swap, But nothing has worked so far. I also tried on R 64 bit for linux and windows (R 2.14) and R 2.11 on windows XP 32 bit. Any help would
2006 Mar 30
1
Writing character vectors with embedded nulls to a connection
Is this possible? I've tried both writeChar() and writeBin() to no avail. My goal is to serialize(ascii=FALSE) an object to a connection but determine the size of the serialized object before hand: sobject <- serialize(object,NULL,ascii=FALSE) len <- nchar(sobject) # # run some code here to notify listener on other end of connection # how many bytes I'm getting ready to send #
2003 Feb 13
5
ESRI shape file import and time-space models
Dear R user, I am running R under Windows 2000. I am looking for a routine for importing - shape files (ESRI) into R - dbase files (FOXPRO) into R and I am looking for time-space models for description and prediction of Bernoulli-, Binomial- and Poissonvaraibles. Thank's a lot for a reply. Sincerely yours, Ekkehardt Altpeter Swiss Federal Office of Public
2007 Jun 14
1
Clarification for readChar man page
Hi, Here's a patch to the readChar manual page (R-trunk as of today) that better clarifies readChar's return value. It could use some work as I'd also like to add some text about using nchar() to find the length of the string that readchar() returns, but I'm unsure which of type="bytes" or type="chars" to mention. Is it type="chars"? Index:
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
2003 Sep 01
1
Re: [R] File Reading Problem (PR#4043)
On Mon, 1 Sep 2003 14:26:43 -0700, "Jiming Yu" <jimingyu@princeton.edu> wrote: >Dear all, > I am trying to read characters byte by byte(in their ASCII codes) from a >file I was going to suggest using readBin, but there seems to be a bug: > con <- file('c:/test.txt','rb') > readBin(con,'c',15,1) stack imbalance in internal readBin, 9
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
2001 Dec 07
2
Memory problem
Dear all, I have written a little R program to convert images. See below. Within the loop over j (the filenames) memory consumption grows constantly. rm( ... ) inside the loop did not help. Memory does not grow if I remove the writeBin statements between the two #-------- marks. But obviously this is not solution I want... Thanks for any advice. Manfred Baumstark P.S. As I'm new to R:
2010 Sep 22
1
help with sockets in R
Hi R gurus, I'm trying to use a ReSTful web service from within R. Specifically, I need to make HTTP PUT requests. I'm able to make the request and that goes well enough, but I'm having trouble properly consuming the HTTP response. The problem comes in when I'm trying to parse out the response body. I get the length of the response body from the Content-Length header. I then try
2018 May 26
2
Buffering in R 3.5 connections causes incorrect data in readChar
I noticed an issue where readChar does not return the correct value after a call to readline. It appears that readChar is not aware of the buffering, so it reads from the end of the buffer, rather than the current position in the file. This is a significant change of behavior from R-3.4.4. Below is a test case that I used to home in on the problem. --- p<-"test2.txt"
2018 May 29
1
Buffering in R 3.5 connections causes incorrect data in readChar
Tomas, Thank you for the explanation. I see in the documentation: "These functions are intended to be used with binary-mode connections." So I see how using it on a text connection is undefined, and not a bug. An error or warning when attempting to use a it on a text connection would be helpful considering how the behavior has changed in R-3.5. On Tue, May 29, 2018 at 3:09 AM, Tomas