[GRASSLIST:9159] Re: import shapefile with v.in.ogr and a script
paul-grass at stjohnspoint.co.uk
Sun Nov 20 11:09:42 EST 2005
On Sun, 20 Nov 2005, Markus Neteler wrote:
> ---script begins---
> for i in *.shp
> echo "importing shape $i..."
> NAME=`basename $i .shp`
> v.in.ogr dsn=$i out=$NAME
> ---script end---
And here is my take on it (untested) :)
(Markus's use of basename is tidier than my sed but I left it in to show a
different way of doing it.) This is untested but should work for filenames
with spaces in them.
ls -1 *.shp | while read i
echo "importing shape $i..."
v.in.ogr dsn="$i" out="`echo $i | sed 's/\.shp$//'`"
More information about the grass-user