<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 I do it?</div>
<div>would something like this work? </div>
<div> </div>
<div>set bb name $1$.$STATION$ ?</div>
<div>w %name.z</div>
<div> </div>
<div>It didn't so far for me?</div>
<div>Would like to hear any suggestions from any one out there....</div>
<div> </div>
<div>Thank you.</div>
<div> </div>
<div>Januka<br> </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> <<a href="mailto:sac-help-request@iris.washington.edu">
sac-help-request@iris.washington.edu</a>> 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> <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> <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> <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> <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 "Re: Contents of sac-help digest..."<br><br><br>Today's Topics:<br><br> 1. Re: Cut command (andreas wessel)
<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 14 Nov 2006 13:44:57 +1300<br>From: "andreas wessel" <<a href="mailto:awbochum@gmail.com">awbochum@gmail.com
</a>><br>Subject: Re: [SAC-HELP] Cut command<br>To: "Talal Merghelani" <<a href="mailto:talalmg1@yahoo.com">talalmg1@yahoo.com</a>><br>Cc: SAC HELP <<a href="mailto:sac-help@iris.washington.edu">sac-help@iris.washington.edu
</a>><br>Message-ID:<br> <<a href="mailto:2afddd310611131644k148e9719x21a328c850048ca8@mail.gmail.com">2afddd310611131644k148e9719x21a328c850048ca8@mail.gmail.com</a>><br>Content-Type: text/plain; charset="iso-8859-1"
<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>"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<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 <<a href="mailto:talalmg1@yahoo.com">
talalmg1@yahoo.com</a>> wrote:<br>><br>> Hi all<br>><br>> i wanna use cut command for many files( 40~60 files) to cut S-wave(usually<br>> 3-5sec time window), for each file they have their own values for cut
<br>> parameters(depend on S-wave).<br>><br>> i have reviewed the sac manual for cut command. but, there is no such way<br>> to select the command cut values indepently for each file..?<br>><br>> its time consuming doing this manaully...!!
<br>><br>> there is any systematic way for doing this by writing a macros command<br>> file..?<br>><br>> of course i care about the result quality. mean, should be the time that i<br>> wanna to cut it exaclty..!!
<br>><br>> any idea any help..!! please, attached with an example..<br>><br>> thank you in advance<br>> Talal<br>><br>> P.S. the input is in *.SAC file and the output is *.TXT file.<br>><br>> ------------------------------
<br>><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>"Nothing can start to exist nor can cease to exist, only transformation is possible"
<br><br>Januka Attanayake<br>Center for Integrative Geosciences - Solid Earth Geophysics<br>University of Connecticut<br>Beach Hall 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>