Re: Copying many files of same pattern from one mapset to another

Nikos Alexandris <[email protected]>
Newsgroups gmane.comp.gis.grass.user
Message-ID <[email protected]>
Rich Shepard:

>   Can't directly move maps from one mapset to another using rename
> (unless
> I'm misreading the manual page), so I need to copy them to the current
> mapset, then change to the source mapset and remove them.
>
>   The g.copy man page does not indicate using regex or pattern to copy
> many
> files at the same time. I have a set of 72 maps of the same pattern
> (test4blk_h_*) created in the wrong mapset. I want to copy them to the
> proper mapset. Is there a way to do this with a single command?

Micha Silver:

>>   I do:
>>   for r in `g.list rast pattern=test4blk_h_* mapset=other_mapset`; do
>>   g.copy rast=${r}@other_mapset,${r};
>>   done

For similarly named maps spread in various Mapsets:

for SCENE in $MAPSETS ;do
        g.copy raster=${PREFIX}@${SCENE},${PREFIX}_${SCENE}
        g.remove -f type=raster name=${PREFIX}@${SCENE}
done

Nikos

_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEAREKAB0WIQRvnUUG88ooOAl00xqQU1NLaTxPswUCWjMMhwAKCRCQU1NLaTxP
s3C1AP96evYjCd+KeNbEgt2PzTTG0EBRBPpI70Zyz6dEAJMplgEApzP2CDGLbpBD
agUfyzOfWzxqMcuznDdDgy6yXsrGXQk=
=n21T
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.