Re: [Numpy-discussion] Reading footer lines

2013-08-13 Thread Chris Barker - NOAA Federal
On Tue, Aug 13, 2013 at 6:01 AM, Daπid wrote: > Alternatively, you could also use seek to put the pointer a certain > distance from the end of the file and start from there, That's what I'd do if the file(s) may be too large to simply dump into memory. > but this could cause problems in Windows

Re: [Numpy-discussion] Reading footer lines

2013-08-13 Thread Daπid
On 13 August 2013 14:20, Resmi wrote: > As a workaround, I've tried using os.system along with grep. And I get the > following output : > os.system("grep -e 'tx' 'data.dat' ") > ## tx =2023.06 > 0 > > Why is there a 0 in the output? The file has no blank lines. That 0 corresponds to the

Re: [Numpy-discussion] Reading footer lines

2013-08-13 Thread Stéfan van der Walt
Hi Resmi On Tue, Aug 13, 2013 at 2:20 PM, Resmi wrote: > I've a list of long files of numerical data ending with footer lines > (beginning with #). I am using numpy.loadtxt to read the numbers, and > loadtxt ignores these footer lines. I want the numpy code to read one of the > footer lines and e

Re: [Numpy-discussion] Reading footer lines

2013-08-13 Thread Peter Cock
On Tue, Aug 13, 2013 at 1:20 PM, Resmi wrote: > Hi, > > I've a list of long files of numerical data ending with footer lines > (beginning with #). I am using numpy.loadtxt to read the numbers, and > loadtxt ignores these footer lines. I want the numpy code to read one of the > footer lines and ext

[Numpy-discussion] Reading footer lines

2013-08-13 Thread Resmi
Hi, I've a list of long files of numerical data ending with footer lines (beginning with #). I am using numpy.loadtxt to read the numbers, and loadtxt ignores these footer lines. I want the numpy code to read one of the footer lines and extract words from it. Is there a way to use loadtxt for this