All,

To print the line from an ASCII file with the maximum z-value, you could do

sort -n -k3 input_file.txt | tail -1

Bruce

On Jan 6, 2008 7:56 AM, G. Allegri <[EMAIL PROTECTED]> wrote:
> That works for an ASCII file, but I was thinking to generalize the use
> cases. Ok, passing through R would require to much RAM, but anyway I
> need to use a driver to handle the binary rasters (I'm saying this
> because I have a similar task but with ArcINFO GRID files).
> What would you do?
>
>
> 2008/1/6, Markus Neteler <[EMAIL PROTECTED]>:
>
> > On Jan 6, 2008 12:12 AM, David Finlayson <[EMAIL PROTECTED]> wrote:
> > > Your task sounds like it would be best done by a small script or C
> > > program. Just read the data in a line-at-a-time and check if the
> > > current line is larger than the previously stored line. At the end of
> > > the file, print out the largest line (to a file if you have multiple
> > > results to store). Probably 5 or 6 lines of Perl/Python at most and
> > > you would be able to read arbitrarily huge files (millions of rows).
> > > Most other solutions would introduce complexity or unnecessary
> > > overhead. For lidar data, you may not have enough RAM to hold the
> > > whole file in memory and the last thing you want to do is attach
> > > topology to each point before you manipulate it.
> >
> > Possibly code from r.in.xyz could be recycled for v.univar to operate
> > on the geometry. I also don't think that you could handle this in R, so
> > a C implementation is needed.
> >
> > Markus
> >
> _______________________________________________
> grass-user mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/grass-user
>



-- 
Bruce Raup
http://cires.colorado.edu/~braup/
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to