[GRASS-dev] erratic behavior of v.in.ascii with WinGRASS

Markus Neteler neteler at osgeo.org
Tue Feb 5 16:01:32 EST 2008


On Feb 5, 2008 4:08 PM, Michael Barton <michael.barton at asu.edu> wrote:
>
> On Feb 5, 2008, at 5:44 AM, Moritz Lennert wrote:
>
> > On 05/02/08 06:00, Michael Barton wrote:
> >> Hi Helena,
> >> It looks like the '|' is partly to blame, but not entirely.
> >> If I use the original file with missmatched numbers of fields
> >> between records AND use the '|' separator, I have trouble on my Mac.
> >> However, if I fix the file so that all records have the same
> >> number of fields (keeping '|' as separator) OR I leave the file
> >> with messed up fields but replace '|' with ',' it works fine.
> >> So it seems more a problem of reading the '|' separator in the
> >> text file in some circumstances than it does having it in the
> >> command string.
> >
> > Just to make sure: I don't think Helena meant that the '|' as
> > separator causes any problems. It's the fact that you use
> >
> > v.in.ascii input=/Users/cmbarton/schools_el_lu.txt
> > output=schools_lu format=point fs=| skip=0 x=1 y=2 z=0 cat=3
> >
> > with fs=| where | is unquoted and thus interpreted as pipe command.
>
> Yes,
>
> I understood. But it also looks like it's more complicated. In some
> circumstances fs=| works OK (i.e., without quotes) and in other
> circumstances it doesn't--suggesting that there also may be a problem
> when v.in.ascii reads the | character in the ascii file in some cases.

Why not adding "pipe" here:

vector/v.in.ascii/in.c
...
    fs = delim_opt->answer;
    if (strcmp(fs, "\\t") == 0)
        fs = "\t";
    if (strcmp(fs, "tab") == 0)
        fs = "\t";
    if (strcmp(fs, "space") == 0)
        fs = " ";

?

Markus


More information about the grass-dev mailing list