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>"some other commands"
<br>q<br><br><br>If you execute the shellscript with <br>"script.sh *.SAC"<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> <<a href="mailto:talalmg1@yahoo.com">talalmg1@yahoo.com</a>> 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> </div> <div>i wanna use cut command for 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>
</div> <div>i have reviewed the sac manual for cut command. but, there is no such way to select the command cut values indepently for each file..?</div> <div> </div> <div>its time consuming doing this manaully...!! </div>
<div> </div> <div>there is any systematic way for doing this by writing a macros command file..?</div> <div> </div> <div>of course i care about the result quality. mean, should be the time that i wanna to cut it exaclty..!!
</div> <div> </div> <div>any idea any help..!! please, attached with an example..</div> <div> </div> <div>thank you in advance</div> <div>Talal</div> <div> </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>