Hamish wrote:

> > I had overlooked the part where loop which adds the separator was
> > replaced with a call to "tr".
> > 
> > Technically, this corresponds to a reduction in functionality, as the
> > previous version would accept any string as a separator, but using
> > "tr" restricts it to a single character (which is probably all that's
> > required).
> 
> is it possible to use sed instead of tr?
>   sed -e "s/\n/$sep/"   # doesn't work

Yes, but you can't do it with a single "s" command. You would need to
collect all of the input into the pattern space with the N command. 
This could be a problem for non-GNU versions of sed which may have a
limit on the maximum length of the pattern space.

OTOH, tr acts as a filter, writing out data as it processes it, so
there is no limit on the amount of data.

> I will have a look at merging Martin, Markus and Glynn's suggestions for
> a flat output g.list flag. As the feature is needed for parsing, I'd
> rather do it as a flag vs. a ncols= option which retains the text and
> fancy format mapset underlines. I've never really known what the "g"
> stands for, but as we use it a lot for parsable output, the flag will
> be '-g' here too.
> 
> so it would look like:
> 
> G63> g.list -g rast
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> 
> G63> g.list -gf rast
> [EMAIL PROTECTED]:
> [EMAIL PROTECTED]:This map has a title
> [EMAIL PROTECTED]:
> [EMAIL PROTECTED]:Raw x,y,z data binned into a raster grid by cell min
> [EMAIL PROTECTED]:Land Use
> [EMAIL PROTECTED]:

According to G_legal_filename(), ":" is legal in map names (that won't
work on Windows):

        if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' || 
            *s == '@' || *s == ',' || *s == '=' || *s == '*' || *s > 0176) {
                fprintf(stderr, _("Illegal filename. Character <%c> not 
allowed.\n"), *s);

I'd suggest using a comma for the field separator.

-- 
Glynn Clements <[EMAIL PROTECTED]>

_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to