MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Undocumented change V5->V6 in Read

  • To: mathgroup at smc.vnet.net
  • Subject: [mg81563] Undocumented change V5->V6 in Read
  • From: dh <dh at metrohm.ch>
  • Date: Wed, 26 Sep 2007 21:55:54 -0400 (EDT)


Hello,

create a file with content: a\r\nb\r\nc\r

where \r and \n symbolize carriage return and line feed.

Now open the file and set the stream pointer successively to 0,1,2.. and 

read a string:

str = OpenRead[filename];

Do[

   SetStreamPosition[str,i];

   Print[ Read[str,String] //FullForm];

,{i,0,4}];

Close[str];

Version 5 gives: "a","","b","","c"

Version 6 gives: "a","b","b","c","c"

Obviously, the implementation of reading a string has been changed.

I like this new "feature", however, it gives me a lot of troubles with 

older programs that parse files using "Find". Here you often needed an 

additional "Skip" that is no more necessary in V6.

One can force the old behavior by the option: NullRecords->True, 

however, I was not able to get the new behavior in V6. Further, in V5 

the default value of NullRecords is False, but there seems to be a bug.

Daniel




  • Prev by Date: Re: Mellin Transform
  • Next by Date: create a list with x,y,z coordinates
  • Previous by thread: Integrate using Assumptions
  • Next by thread: create a list with x,y,z coordinates