<div>Greetings,</div>
<div>I have a question regarding naming files. Assume that I have a sac file by the name</div>
<div>2006.300.33.SDMD.BHZ.R.SAC</div>
<div>say, If I want to extract only the 2006.300.33.SDMD part for naming purposes after I do certain calculations on it, how do&nbsp;I do it?</div>
<div>would something like this work? </div>
<div>&nbsp;</div>
<div>set bb name $1$.$STATION$ ?</div>
<div>w %name.z</div>
<div>&nbsp;</div>
<div>It didn't so far for me?</div>
<div>Would like to hear any suggestions from any one out there....</div>
<div>&nbsp;</div>
<div>Thank you.</div>
<div>&nbsp;</div>
<div>Januka<br>&nbsp;</div>
<div><span class="gmail_quote">On 11/14/06, <b class="gmail_sendername"><a href="mailto:sac-help-request@iris.washington.edu">sac-help-request@iris.washington.edu</a></b> &lt;<a href="mailto:sac-help-request@iris.washington.edu">
sac-help-request@iris.washington.edu</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Send sac-help mailing list submissions to<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:sac-help@iris.washington.edu">sac-help@iris.washington.edu
</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.iris.washington.edu/mailman/listinfo/sac-help">http://www.iris.washington.edu/mailman/listinfo/sac-help</a><br>or, via email, send a message with subject or body 'help' to
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:sac-help-request@iris.washington.edu">sac-help-request@iris.washington.edu</a><br><br>You can reach the person managing the list at<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:sac-help-owner@iris.washington.edu">
sac-help-owner@iris.washington.edu</a><br><br>When replying, please edit your Subject line so it is more specific<br>than &quot;Re: Contents of sac-help digest...&quot;<br><br><br>Today's Topics:<br><br>&nbsp;&nbsp;1. Re:&nbsp;&nbsp;Cut command (andreas wessel)
<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 14 Nov 2006 13:44:57 +1300<br>From: &quot;andreas wessel&quot; &lt;<a href="mailto:awbochum@gmail.com">awbochum@gmail.com
</a>&gt;<br>Subject: Re: [SAC-HELP] Cut command<br>To: &quot;Talal Merghelani&quot; &lt;<a href="mailto:talalmg1@yahoo.com">talalmg1@yahoo.com</a>&gt;<br>Cc: SAC HELP &lt;<a href="mailto:sac-help@iris.washington.edu">sac-help@iris.washington.edu
</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="mailto:2afddd310611131644k148e9719x21a328c850048ca8@mail.gmail.com">2afddd310611131644k148e9719x21a328c850048ca8@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset=&quot;iso-8859-1&quot;
<br><br>Hi Talal,<br><br>you could create a shellscript that runs your cutting macro for every<br>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<br>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<br>sac and then execute the commands in the macro.
<br>You still would have to figure out a way to calculate the parameters for<br>every file, but this depends on what you want.<br><br>ciao,<br>Andreas<br><br><br><br><br>On 11/14/06, Talal Merghelani &lt;<a href="mailto:talalmg1@yahoo.com">
talalmg1@yahoo.com</a>&gt; wrote:<br>&gt;<br>&gt; Hi all<br>&gt;<br>&gt; i wanna use cut command for many files( 40~60 files) to cut S-wave(usually<br>&gt; 3-5sec time window), for each file they have their own values for cut
<br>&gt; parameters(depend on S-wave).<br>&gt;<br>&gt; i have reviewed the sac manual for cut command. but, there is no such way<br>&gt; to select the command cut values indepently for each file..?<br>&gt;<br>&gt; its time consuming doing this manaully...!!
<br>&gt;<br>&gt; there is any systematic way for doing this by writing a macros command<br>&gt; file..?<br>&gt;<br>&gt; of course i care about the result quality. mean, should be the time that i<br>&gt; wanna to cut it exaclty..!!
<br>&gt;<br>&gt; any idea any help..!! please, attached with an example..<br>&gt;<br>&gt; thank you in advance<br>&gt; Talal<br>&gt;<br>&gt; P.S. the input is in *.SAC file and the output is *.TXT file.<br>&gt;<br>&gt; ------------------------------
<br>&gt;<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://www.iris.washington.edu/pipermail/sac-help/attachments/20061113/b953fb91/attachment-0001.html">http://www.iris.washington.edu/pipermail/sac-help/attachments/20061113/b953fb91/attachment-0001.html
</a><br><br>------------------------------<br><br>_______________________________________________<br>sac-help mailing list<br><a href="mailto:sac-help@iris.washington.edu">sac-help@iris.washington.edu</a><br><a href="http://www.iris.washington.edu/mailman/listinfo/sac-help">
http://www.iris.washington.edu/mailman/listinfo/sac-help</a><br><br><br>End of sac-help Digest, Vol 17, Issue 9<br>***************************************<br></blockquote></div><br><br clear="all"><br>-- <br>&quot;Nothing can start to exist nor can cease to exist, only transformation is possible&quot;
<br><br>Januka Attanayake<br>Center for Integrative Geosciences - Solid Earth Geophysics<br>University of Connecticut<br>Beach Hall&nbsp;&nbsp; U-2045<br>354,Mansfield Rd;<br>Storrs.CT 06269<br><br>Tel: 1 860 486 0475<br><a href="http://www.geocities.com/jattanayake">
http://www.geocities.com/jattanayake</a><br><a href="http://earth.uconn.edu/">http://earth.uconn.edu/</a>