[GRASSLIST:9155] Re: import shapefile with v.in.ogr and a script , qgis

Markus Neteler neteler at itc.it
Sun Nov 20 08:48:13 EST 2005


On Sun, Nov 20, 2005 at 12:35:43PM +0100, Stephan Holl wrote:
> On Sun, 20 Nov 2005 11:52:56 +0100 Helmut Kudrnovsky <hellik at web.de>
...
> just write a short shell-script for batch-import
> 
> untested:
> ---script begins---
> #/bin/bash

please fix to

#!/bin/bash


> for i in `ls *.shp`
> do
>   echo "importing shape $i..."
>   v.in.ogr dsn=$i out=`echo $i|cut -d"." -f1`
> 
> done
> ---script end---

You may modify this to

---script begins---
#!/bin/sh

for i in *.shp
do
  echo "importing shape $i..."
  NAME=`basename $i .shp`
  v.in.ogr dsn=$i out=$NAME
done
---script end---

Markus




More information about the grass-user mailing list