[BLDG-SIM] eQuest: Macro for extracting data from a sim file - SED Example

Brandon Nichols BrandonN at Hargis.biz
Mon Nov 5 21:07:31 PST 2007


All,
 
See this post
<http://elcca-exchange.blogspot.com/2007/11/sed-equest-sim-file-reports.
html>  for an example script using SED to extract an individual report
from a SIM file. 
 
But wait, there's more!  Using the 'FOR' command, it can also extract
every similar report from all SIM files in a directory and save them to
single file for further processing (with say Awk, for instance ;-) or
output.  Its beginning to look to me like SED is most useful for gross
editing tasks -- i.e. global search-and-replacements or chunking out
reports.  SED = sledgehammer
 
Looks like Awk will be the ticket for precision tasks like selecting an
individual data value, doing arithmetic on columns, or creating your own
outside air loads report.  Awk = scalpel
 
More fun with SED & AWK coming in the months ahead...Jeff, would you
mind sharing some of your favorite Awk scripts?  There is a basic one by
Joe Huang in the archives.  Perhaps you have an indispensable gem like
say, an Outside Air Loads Report? ;-)
 
Thanks
 
Brandon Nichols, PE, LEED(r) AP
Mechanical
HARGIS ENGINEERS

600 Stewart Street

Suite 1000

Seattle, WA 98101

www.hargis.biz

 

d | 206.436.0400  c | 206.228.8707

o | 206.448.3376  f  | 206.448.4450

 
 

  _____  

From: BLDG-SIM at gard.com [mailto:BLDG-SIM at gard.com] On Behalf Of Brandon
Nichols
Sent: Monday, November 05, 2007 7:21 AM
To: BLDG-SIM at gard.com
Subject: [BLDG-SIM] eQuest: macro for extracting data from a sim file




Awk is also a good choice, here's an editorial comparison of Awk vs.
SED, with a link to tutorials for each:

http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2004-08/0405.html

Awk is a programming language with arithmetic operators, array handling
etc., SED is essentially batch application of regular expressions. 

Given the platform independence of regular expressions, SED is my cup of
tea.  But as Jeff states the case, Awk would be an excellent tool for a
data extraction task -- back in the dark ages of DOS, I used Awk years
before learning SED to strip the colors from AutoCAD DXF files.

Brandon



-----Original Message-----
From:   BLDG-SIM at gard.com on behalf of Jeff Haberl
Sent:   Sat 11/3/2007 7:07 PM
To:     BLDG-SIM at gard.com
Cc:    
Subject:        [BLDG-SIM] eQuest: macro for extracting data from a sim
file

Jessica.

We use AWK, which can be obtained from Gnu software for a modest
donation (I.e. GAWK). Its incredibly powerful, and has a long history
from its origin at Bell labs as a unix toolkit. There are several good
books on AWK, including one by its creators: Aho, Weinberger and
Kernigan.

This work well on the FORTRAN-formatted output from DOE-2.

Jeff 
BB 8=!  8=)  :=)  8=)  ;=)  8=)  8=(  8=)  :=')  8=)  8=)  8=? BB

Jeff S. Haberl, Ph.D.,
P.E.............................jhaberl at esl.tamu.edu

Professor......................................................Office
Ph: 979-845-6507

Department of Architecture.......................Lab Ph: 979-845-6065

Energy Systems Laboratory.......................FAX: 979-862-2457

Texas A&M University..............................77843-3581

College Station, Texas, USA.......................URL: www-esl.tamu.edu

BB 8=/  8=)  :=)  8=)  ;=)  8=)  8=()  8=) 8=?  8=)  8=)  8= BB


----- Original Message -----
From: BLDG-SIM at gard.com <BLDG-SIM at gard.com>
To: BLDG-SIM at gard.com <BLDG-SIM at gard.com>
Sent: Fri Nov 02 16:35:03 2007
Subject: [BLDG-SIM] eQuest: macro for extracting data from a sim file

I need to extract data from a sim file. I have over 1600 runs to make
and need only one piece of data from the SIM file. Has anyone put
together a macro like this before? Examples...

Thanks, Jessica


Jessica E. McCready
Energy Engineer
KEMA Services Inc.
492 Ninth Street, Suite 220
Oakland, CA 94607
T 510-891-0446
F 510-891-0440
jessica.mccready at kema.com
Please visit our website www.kema.com <file://www.kema.com> 



==================
You received this e-mail because you are subscribed
to the BLDG-SIM at GARD.COM mailing list.  To unsubscribe
from this mailing list send a blank message to
BLDG-SIM-UNSUBSCRIBE at GARD.COM







==================
You received this e-mail because you are subscribed 
to the BLDG-SIM at GARD.COM mailing list.  To unsubscribe 
from this mailing list send a blank message to 
BLDG-SIM-UNSUBSCRIBE at GARD.COM


===========================
You received this e-mail because you are subscribed 
to the BLDG-SIM at GARD.COM mailing list.  To unsubscribe 
from this mailing list send a blank message to 
BLDG-SIM-UNSUBSCRIBE at GARD.COM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/bldg-sim-onebuilding.org/attachments/20071105/00c8f6a7/attachment.htm>


More information about the Bldg-sim mailing list