Friday 31 March 2017

mapinfo - Batch Script to merge tab fles in a directory


Very similar to this question Merging multiple .tab files? can someone please help me with a batch script for this?


Based on the answer in the above I have


#!/bin/bash
for i in *.tab;
do
ogr2ogr -update -append merge.tab i -f “MapInfo File” -nln merge
done


but when I run it it fails with


FAILURE:
Unable to open datasource `i' with the following drivers.

and then lists the drivers



Answer



For completeness, and based on the above comments, this should work:


ogr2ogr -update -append merge.tab $i -f “MapInfo File” -nln merge

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...