[GRASS-user] v.out.ascii output modification

Hamish hamish_b at yahoo.com
Wed Dec 16 16:38:08 EST 2009


Maxime Phaneuf wrote:
> As the title says, I'm trying to use r.profile with the
> output of r.drain. I
> know I cannot use directly the output, and instead I need
> to transform
> r.drain to a vector line and transform it to a ascii point
> file (v.out.ascii).
> 
> So, when the output form r.drain has been transformed to a
> ascii point file,
> I cannot use it because there is a third column (the
> category) preventing me
> from piping it into r.profile. I tried deleting the
> category but this
> doesn't work.
> 
> I can always use awk to delete characters in the ascii file
> that I don't
> need, but I was wondering if there is a quicker way to do it.
> 
> Basically what I need is to get from this ascii point
> file:
> X   Y     CAT
> xxx|yyy|1
> xxx|yyy|1
> 
> to:
> 
> X    Y
> xxx|yyy
> 
> without using a awk-like method.
> 
> Is it possible?


cat $xyfile | cut -f1,2 -d'|'


Hamish



      


More information about the grass-user mailing list