Opened 6 years ago

Last modified 5 years ago

#3627 new enhancement

i.group: file= parameter for input desired

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Imagery Version: 7.4.0
Keywords: i.group Cc:
CPU: Unspecified Platform: All

Description

To enter the input to i.group can reach a significant number of map names.

On Unix like systems backticks can be used to feed in g.list output with regex/wildcard search. However, this fails on Windows. Here the file parameter would be handy:

# r.series example, also works on Windows as no backticks involved
g.list rast pattern="tmean.1981_2010.*.avg" output=list_tmean_1981_2010.csv
r.series file=list_tmean_1981_2010.csv ...

Wish: add a "file" parameter to i.group is it exists for r.series and other commands.

Change History (7)

comment:1 by mmetz, 6 years ago

Please try trunk r73147

in reply to:  1 ; comment:2 by neteler, 6 years ago

Replying to mmetz:

Please try trunk r73147

Works like a charm, thanks! I'd be happy to see that backported since 7.4 will be used by many (Windows) users for a while...

in reply to:  description comment:3 by hellik, 6 years ago

Replying to neteler:

To enter the input to i.group can reach a significant number of map names.

On Unix like systems backticks can be used to feed in g.list output with regex/wildcard search. However, this fails on Windows. Here the file parameter would be handy:

# r.series example, also works on Windows as no backticks involved
g.list rast pattern="tmean.1981_2010.*.avg" output=list_tmean_1981_2010.csv
r.series file=list_tmean_1981_2010.csv ...

Wish: add a "file" parameter to i.group is it exists for r.series and other commands.

for the record, see https://lists.osgeo.org/pipermail/grass-user/2018-June/078526.html

not as elegant in linux, but you can do something similar in windows too

e.g. in the winGRASS command line:

:\>FOR /F %c in ('g.list "type=raster" "pattern=*2" "mapset=user1" "separator=comma"') DO SET RASTER2REMOVE=%c

C:\>SET RASTER2REMOVE=b172,d172,it172,r172

C:\>echo %RASTER2REMOVE%
b172,d172,it172,r172


C:\>g.remove type=raster name=%RASTER2REMOVE%
The following data base element files would be deleted:
raster/b172@user1
raster/d172@user1
raster/it172@user1
raster/r172@user1
WARNING: Nothing removed. You must use the force flag (-f) to actually
         remove them. Exiting. 

in reply to:  2 ; comment:4 by mmetz, 6 years ago

Replying to neteler:

Replying to mmetz:

Please try trunk r73147

Works like a charm, thanks! I'd be happy to see that backported since 7.4 will be used by many (Windows) users for a while...

This enhancement is mainly targeting Windows users, and Windows users are welcome to get the latest daily build from https://grass.osgeo.org/download/software/ms-windows/

in reply to:  4 comment:5 by neteler, 6 years ago

Replying to mmetz:

This enhancement is mainly targeting Windows users, and Windows users are welcome to get the latest daily build from https://grass.osgeo.org/download/software/ms-windows/

This does not work in production... ok time to release 7.6.0 then

comment:6 by martinl, 5 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:7 by martinl, 5 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.