[GRASSLIST:5467] v.in.ascii

dear grass list,

I am on grass60beta1:

I need to import an ascii tab-separated file composed of 4 columns:
cat,lat,long,depth

I have a problem with v.in.ascii, I get "get xcol> minimum last column number "

This is what I do and get:

GRASS 6.0.cvs:~ > v.in.ascii -z input=LatLon_AC_thous.dat output=prova_again1 fs=tab columns='x double, y double, z double, cat int' x=2 y=3 z=4 cat=1

D2/3: Vect_open_new(): name = prova_sismi_again1
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: V1_open_new_nat(): name = prova_sismi_again1
D1/3: Vect_get_thresh(): thresh = 0.000000
D1/3: dig__write_head()
D1/3: write coor size (0) to head
D2/3: coor body offset 14
D3/3: dig_init_plus()
D1/3: dig_spidx_init()
D3/3: dig_cidx_init()
D3/3: Vect_hist_command()
D3/3: G_recreate_command()
Maximum input row length: 26
Maximum number of columns: 1
Minimum number of columns: 1
ERROR: xcol > minimum last column number
GRASS 6.0.cvs:~ >

Apparently x=2 is wrong (?) but if I delete the column of <cat> and
try to import with <x=1, y=2, z=3> I get the same ERROR with ycol (i.e.
ERROR: ycol > minimum last column number

Can anyone tell me where I am wrong??

many thanks,

Francesco

I am on grass60beta1:

I need to import an ascii tab-separated file composed of 4 columns:
cat,lat,long,depth

I have a problem with v.in.ascii, I get "get xcol> minimum last column
number "

This is what I do and get:

GRASS 6.0.cvs:~ > v.in.ascii -z input=LatLon_AC_thous.dat
output=prova_again1 fs=tab columns='x double, y double, z double,
cat int' x=2 y=3 z=4 cat=1

D2/3: Vect_open_new(): name = prova_sismi_again1
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: V1_open_new_nat(): name = prova_sismi_again1
D1/3: Vect_get_thresh(): thresh = 0.000000
D1/3: dig__write_head()
D1/3: write coor size (0) to head
D2/3: coor body offset 14
D3/3: dig_init_plus()
D1/3: dig_spidx_init()
D3/3: dig_cidx_init()
D3/3: Vect_hist_command()
D3/3: G_recreate_command()
Maximum input row length: 26
Maximum number of columns: 1
Minimum number of columns: 1

^^^^ It could only see one column.

ERROR: xcol > minimum last column number

as it only thinks there is one column, column 2 (ie x) doesn't exist.

GRASS 6.0.cvs:~ >

Apparently x=2 is wrong (?) but if I delete the column of <cat> and
try to import with <x=1, y=2, z=3> I get the same ERROR with ycol
(i.e. ERROR: ycol > minimum last column number

Can anyone tell me where I am wrong??

It'll be the fs=tab part which is having problems. try fs='\t'?
Still working on fixing this up; haven't finshed yet; you might try
updating from CVS although that is still in flux I think.

try doing a search & replace of the tabs with "|" in the mean time?

Hamish

Hi Hamish,
many thanks for yout reply, yes, the "pipe" option works, so as you
said, maybe is the "fs=tab" part which is having problems.....

However there still is a problem with the table. I am on postgres:

I run <db.connect>, <db.login> and <v.db.connect>, the connection seems to work, but:
even if in the query of the vector points (<d.what.vect>) the info in the form are well displayed and the name of the table exist, there is a messege like:

..."Cannot open database 'host=localhost,dbname=cesco_pgsql,user=mirabell' by driver 'pg" ..... which does not seem true because the info in the form, including the table name, are correct.

Moreover, even if the table seems created (according the d.what.vect form), if I access the database with e.g. pgaccess the table does not exist... so, where is it putting the table??

any ideas? am I wrong somewhere??

Many thanks for your support
cheers

Francesco

On Mon, Jan 24, 2005 at 12:18:34PM +1300, Hamish wrote:

> I am on grass60beta1:
>
> I need to import an ascii tab-separated file composed of 4 columns:
> cat,lat,long,depth
>
> I have a problem with v.in.ascii, I get "get xcol> minimum last column
> number "
>
> This is what I do and get:
>
> GRASS 6.0.cvs:~ > v.in.ascii -z input=LatLon_AC_thous.dat
> output=prova_again1 fs=tab columns='x double, y double, z double,
> cat int' x=2 y=3 z=4 cat=1
>
> D2/3: Vect_open_new(): name = prova_sismi_again1
> D1/3: Vect_set_thresh(): thresh = 0.000000
> D1/3: V1_open_new_nat(): name = prova_sismi_again1
> D1/3: Vect_get_thresh(): thresh = 0.000000
> D1/3: dig__write_head()
> D1/3: write coor size (0) to head
> D2/3: coor body offset 14
> D3/3: dig_init_plus()
> D1/3: dig_spidx_init()
> D3/3: dig_cidx_init()
> D3/3: Vect_hist_command()
> D3/3: G_recreate_command()
> Maximum input row length: 26
> Maximum number of columns: 1
> Minimum number of columns: 1

^^^^ It could only see one column.

> ERROR: xcol > minimum last column number

as it only thinks there is one column, column 2 (ie x) doesn't exist.

> GRASS 6.0.cvs:~ >
>
> Apparently x=2 is wrong (?) but if I delete the column of <cat> and
> try to import with <x=1, y=2, z=3> I get the same ERROR with ycol
> (i.e. ERROR: ycol > minimum last column number
>
> Can anyone tell me where I am wrong??

It'll be the fs=tab part which is having problems. try fs='\t'?
Still working on fixing this up; haven't finshed yet; you might try
updating from CVS although that is still in flux I think.

try doing a search & replace of the tabs with "|" in the mean time?

Hamish