Re: [GRASS-user] Renaming many files with one command

2017-03-18 Thread Markus Neteler
On Mar 18, 2017 7:55 PM, "Markus Neteler" wrote: > > On Mar 18, 2017 10:42 AM, "Rich Shepard" wrote: > > > > I inadvertently overwrote a set of 25 output maps and want to change their > > names using g.rename. The manual page shows that g.rename

Re: [GRASS-user] Renaming many files with one command

2017-03-18 Thread Rich Shepard
On Sat, 18 Mar 2017, Vincent Bain wrote: Weird... sorry, I just notice you meant to rename rasters, not vectors. Anyway, here it works as well with rasters GRASS 7.3.svn (local):~ > for i in `g.list type=raster pattern=open_h_*`;do g.rename rast=$i,`echo $i | sed

Re: [GRASS-user] Renaming many files with one command

2017-03-18 Thread Vincent Bain
Le samedi 18 mars 2017 à 10:45 -0700, Rich Shepard a écrit : >Here's the verbatim command: > > for i in `g.list type=raster pattern=open_h_*`; do g.rename rast=$i,`echo > $i | sed /open_h_/blocked_h_/g`; done > Lastly, I would suggest you to try the same command with no space after the

Re: [GRASS-user] Renaming many files with one command

2017-03-18 Thread Vincent Bain
Weird... sorry, I just notice you meant to rename rasters, not vectors. Anyway, here it works as well with rasters GRASS 7.3.svn (local):~ > g.list rast open_h_aze open_h_qsd GRASS 7.3.svn (local):~ > for i in `g.list type=raster pattern=open_h_*`;do

Re: [GRASS-user] Renaming many files with one command

2017-03-18 Thread Rich Shepard
On Sat, 18 Mar 2017, Vincent Bain wrote: Rich, this should work indeed (I just tested it down here, it works)... at least if you have sed installed on your system. And also carefully mind the reverse quotes(``) that enclose subprocesses. Vincent, Yes, sed is part of all linux distributions

Re: [GRASS-user] Renaming many files with one command

2017-03-18 Thread Vincent Bain
Le samedi 18 mars 2017 à 09:13 -0700, Rich Shepard a écrit : > On Sat, 18 Mar 2017, Vincent Bain wrote: > > for i in `g.list type=vector pattern=open_h_*`;do g.rename vect=$i,`echo > > $i | sed s/open_h_/blocked_h_/g`;done >It's close, but not complete: Rich, this should work indeed (I

Re: [GRASS-user] Renaming many files with one command

2017-03-18 Thread Rich Shepard
On Sat, 18 Mar 2017, Vincent Bain wrote: my one-liner 2-cents solution : for i in `g.list type=vector pattern=open_h_*`;do g.rename vect=$i,`echo $i | sed s/open_h_/blocked_h_/g`;done Vincent, It's close, but not complete: Renames data base element files in the user's current mapset.

Re: [GRASS-user] Renaming many files with one command

2017-03-18 Thread Vincent Bain
Hi Rich, my one-liner 2-cents solution : for i in `g.list type=vector pattern=open_h_*`;do g.rename vect=$i,`echo $i | sed s/open_h_/blocked_h_/g`;done Hope this helps ! Vincent. Le samedi 18 mars 2017 à 07:42 -0700, Rich Shepard a écrit : >I inadvertently overwrote a set of 25 output

Re: [GRASS-user] GRASS, ordinal not in range(128)

2017-03-18 Thread Andres Solarte
Hello Markus, the first suggestion solved the problem thank you so much, now it works :) Gracias Vero también a vos!!! Regards, Andrés. 2017-03-17 16:37 GMT-03:00 Markus Neteler : > Hi, > > On Wed, Mar 15, 2017 at 12:59 PM, Andres Solarte >

[GRASS-user] Renaming many files with one command

2017-03-18 Thread Rich Shepard
I inadvertently overwrote a set of 25 output maps and want to change their names using g.rename. The manual page shows that g.rename raster=from,to can be applied to map(s), but there's no example for multiple maps. In my situation I want to change the pattern 'open_h_*' to 'blocked_h_*'. I