[GRASS-dev] Fwd: Re: [GRASS GIS] #2692: v.in.ascii does not handle text in qoutes
Moritz Lennert
mlennert at club.worldonline.be
Tue Jun 16 06:53:58 PDT 2015
Glynn,
Could you just take a look at the patch and say whether this is an
acceptable hack ?
Moritz
-------- Forwarded Message --------
Subject: Re: [GRASS GIS] #2692: v.in.ascii does not handle text in qoutes
Date: Sun, 14 Jun 2015 12:18:09 -0000
From: GRASS GIS <trac at osgeo.org>
Reply-To: grass-dev at lists.osgeo.org
To: undisclosed-recipients:;
#2692: v.in.ascii does not handle text in qoutes
-------------------------+-------------------------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Default | Version: svn-trunk
Resolution: | Keywords: CSV, doublequote, singlequote, text
CPU: | delimiter
Unspecified | Platform: Unspecified
-------------------------+-------------------------------------------------
Comment (by mlennert):
Replying to [comment:1 mlennert]:
> Replying to [ticket:2692 wenzeslaus]:
> > Since r63581 G7:v.in.ascii should be able to handle "CSV with quoted
text fields" (`text` option) but the quotes are stored to the database.
This is the result from `v.db.select` (same thing in `sqliteman`):
> >
> > {{{
> > 100|437343.6704|4061363.41525|"High Erosion"|"Low Deposition"
> > }}}
> >
>
> IIUC, this comes from
[https://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/token.c#L107
this part of lib/gis/token.c]. The p++ just advances the pointer like for
any other character. I guess that in order to skip it, one would have to
create a second pointer which takes a copy of the first, but advances only
when the first one is not equal to the character you want to eliminate. Or
something like that. But my pointer foo is much too low to handle this
directly. Anyone more C-savy who could do this in 5 minutes ?
The attached patch seems to solve the problem for me, but it feels like a
quick fix and there probably is a better way...
Moritz
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2692#comment:2>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list