Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to reproject all the layers from a database, but some of them are undefined and some are defined in a wrong projection. I would like to sort all those layers in a text file with their source projection and their path. I tried:

For /R %f in (*.tab) do ogrinfo -al -so %~dpnxf > list.txt

The fact is only the last layer return a result in the list.txt. Do you know why? Is there a more appropriate method to overcome that projection problem?

share|improve this question

closed as off-topic by iant Jul 31 '13 at 13:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about general computing hardware and software are off-topic here, but can be asked on Super User." – iant
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 4 down vote accepted

I guess you might want to append (>>) the projection to list.txt and not assign (>), otherwise list.txt will be overwritten at each iteration of your for loop.

For /R %f in (*.tab) do ogrinfo -al -so %~dpnxf >> list.txt
share|improve this answer
reference for how redirect in a command shell works: – matt wilkie Jul 31 '13 at 18:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.