[GRASSLIST:4642] Re: creating a table from ascii data?

Markus Neteler neteler at itc.it
Tue Oct 26 05:10:27 EDT 2004


On Mon, Oct 25, 2004 at 06:58:24AM -0600, Richard Greenwood wrote:
> On Mon, 25 Oct 2004 17:08:03 +1300, Hamish <hamish_nospam at yahoo.com> wrote:
> > Hello,
> > 
> > I am trying to convert a multi column text file[*] into a table which I
> > can then connect to a (5.7) vector map. I can't quite see how to do
> > this. Any ideas?
> > This is for a script, so "use OpenOffice & save as DBF" won't work.
> > 
> > [*] say .csv file; col1=cat col2=attr, etc.
> > 
> > thanks,
> > Hamish

Hi Hamish,

not sure if this is what you need, but v.in.ascii accepts multiple
attributes:

# Generate a 3D points vector file 'points3d.dat' with attributes as ASCII file:
# (here Spearfish)
593493.1|4914730.2|123.1|studna|well
591950.2|4923000.5|222.3|kadibudka|closet
589860.5|4922000.0|232.3|hruska|pear
590400.5|4922820.8|143.2|mysi dira|mouse hole
593549.3|4925500.7|442.6|mineralni pramen|mineral spring
600375.7|4925235.6|342.2|kozi stezka|goat path

#Import into GRASS:
cat points3d.dat | v.in.ascii -z zcol=3 catcol=0 out=mypoints3D \
                   columns='x double, y double, z double, label_cz varchar(20), label_en varchar(20)'
v.info -c mypoints3D
v.info mypoints3D


Markus




More information about the grass-user mailing list