Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: fairfield@sldb4.slac.stanford.edu
Subject: Re: Need line counting program for Alpha OpenVMS
Date: 1997/11/17	[thread overview]
Message-ID: <1997Nov17.183728.1@sldb4.slac.stanford.edu> (raw)
In-Reply-To: 3470F85B.20B4@snipak.netik


In article <3470F85B.20B4@snipak.netik>, 
    			Peter Mroz <pmrozek@snipak.netik> writes:
> I need a fast line counting program.  I wrote a simple C program that
> reads a file in byte by byte, and increments a counter when it
> encounters a newline.  However, it's pretty slow on large files.  Has
> someone written a program that takes advantage of VMS system service
> calls to perform the same task?

        How about:

        	$ search/stat/out=nl:  the.file  ""

    It's very fast, and the number of records searched, i.e., the count
    of lines in the file, appear in the last line of the output.

> Also, I've got a version of the Unix "tail" command that runs under VMS,
> but not Alpha OpenVMS.  It's pretty handy for looking at the last n
> lines of a batch log file for a long running job.  Has anyone gotten
> this to work on Alpha OpenVMS?  I can post the source if anyone's
> interested.

        There are various TAIL  and  MORE,  etc., varients available for
    VMS.  However, since you mention Alpha, VMS since V6.1 (I think) has
    had  TYPE/TAIL[=nn]  and TYPE/PAGE (and TYPE/TAIL/PAGE, etc.)  which
    _mostly_ do the job.  TYPE/TAIL and TYPE/PAGE (in  fact,  the  /PAGE
    qualifier  to  a whole bunch of VMS verbs) first appeared in VMS 6.1
    (or 6.2, I don't  recall  which  at  the  moment)  on _both_ VAX and
    Alpha.

        Someone is bound to jump in here and point out that, for certain
    file organizations,  TYPE/TAIL  won't  work,  but  in  those (rare?)
    cases,  one of the freeware TAIL programs will do the job.  See  any
    of the fine VMS freeware sites in  your  area.   :-)  Andy  Harper's
    server,  ftp2.kcl.ac.uk, has two TAIL varients and two MORE varients
    (MOST and SMORE).  Hunter  Goatley's  server,  ftp.wku.edu, alos has
    SMORE nad MOST.

        So you really don't need  your  unix ports, VMS has them already
    (unless you're running on a very old version), either built in or as
    freeware.

        -Ken
-- 
 Kenneth H. Fairfield       |  Internet: Fairfield@Slac.Stanford.Edu
 SLAC, P.O.Box 4349, MS 46  |  DECnet:   45537::FAIRFIELD (45537=SLACVX)
 Stanford, CA   94309       |  Voice:    650-926-2924    FAX: 650-926-3515
 -------------------------------------------------------------------------
 These opinions are mine, not SLAC's, Stanford's, nor the DOE's...



       reply	other threads:[~1997-11-17  5:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3470F85B.20B4@snipak.netik>
1997-11-17  5:00 ` fairfield [this message]
1997-11-18  5:00   ` Need line counting program for Alpha OpenVMS Peter Prymmer
1997-11-18  5:00 ` Petri Backstrom
1997-11-23  5:00 ` Phillip Helbig
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox