Hi Talal, <br><br>you could create a shellscript that runs your cutting macro for every sac-file in the current directory:<br>I used that to byteswap a lot of files at once:<br><br>for j in $*<br>do<br>fn=$j<br>echo sac_starts_here %%%%%%%%%%%%%%%%
<br>/usr/local/bin/sac /macro/macro.m $fn<br>done<br>exit 0<br><br>You have to adjust the pathes to point to your sac binary and to the macro you want to use.<br>The macro looks like this:<br><br>r $1<br>&quot;some other commands&quot;
<br>q<br><br><br>If you execute the shellscript with <br>&quot;script.sh *.SAC&quot;<br>the for loop will cycle through all the .SAC files, read every single one in sac and then execute the commands in the macro.<br>You still would have to figure out a way to calculate the parameters for every file, but this depends on what you want.
<br><br>ciao,<br>Andreas<br><br><br><br><br><div><span class="gmail_quote">On 11/14/06, <b class="gmail_sendername">Talal Merghelani</b> &lt;<a href="mailto:talalmg1@yahoo.com">talalmg1@yahoo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi all</div>  <div>&nbsp;</div>  <div>i wanna use cut command for&nbsp;many files( 40~60 files) to cut S-wave(usually 3-5sec time window), for each file they have their own values for cut parameters(depend on S-wave).</div>  <div>
&nbsp;</div>  <div>i have reviewed the sac manual for cut command. but, there is no such&nbsp;way to select the command cut values indepently for each file..?</div>  <div>&nbsp;</div>  <div>its time consuming doing this manaully...!! </div>
  <div>&nbsp;</div>  <div>there&nbsp;is any systematic way for doing this&nbsp;by writing a macros command file..?</div>  <div>&nbsp;</div>  <div>of course i care about the result quality. mean, should be the time that i wanna to cut it exaclty..!!
</div>  <div>&nbsp;</div>  <div>any idea any help..!! please, attached with an example..</div>  <div>&nbsp;</div>  <div>thank you in advance</div>  <div>Talal</div>  <div>&nbsp;</div>  <div>P.S. the input is in *.SAC file and the output is *.TXT file.
</div><span class="ad"><p> 

</p><hr size="1"></span></blockquote></div><br>