Can somebody help with looping my command?

Reply

Join Date: Apr 2009
Posts: 2
Reputation: SoftwareMatters is an unknown quantity at this point 
Solved Threads: 0
SoftwareMatters SoftwareMatters is offline Offline
Newbie Poster

Can somebody help with looping my command?

 
0
  #1
Oct 7th, 2009
Hi,

I am using a set of tools called FWTools which runs commands in the shell window. One command that I am using edits tif files by adding an overview to the file. The syntax is:

gdaladdo -r average "D:\Map Files\Tiffs\ST00.TIF" 2 4 8 16 32

What I need to do is run this command on 800 files in the directory D:\Map Files\Tiffs - is this possible?

I was thinking something like:

for %x in (*.tif) do gdaladdo -r average %x 2 4 8 16 32 but am not getting very far.

Any help or advice is welcome.

Regards

JD
Software-Matters
Simple Solutions That Work
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,793
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 698
Sponsor
Featured Poster
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast
 
0
  #2
Oct 8th, 2009
Just take the echo out of the command:
  1. sk@svn:/tmp/tif$ touch 1.tif 2.TiF 3.TIF
  2. sk@svn:/tmp/tif$ find ./ -type f -iname \*.tif -exec echo gdaladdo -r average \"{}\" 2 4 8 16 32 \;
  3. gdaladdo -r average "./2.TiF" 2 4 8 16 32
  4. gdaladdo -r average "./1.tif" 2 4 8 16 32
  5. gdaladdo -r average "./3.TIF" 2 4 8 16 32
  6.  
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 713 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC