LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 21 Nov 2007 17:11:19 +0000
Reply-To:   iw1junk@COMCAST.NET
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ian Whitlock <iw1junk@COMCAST.NET>
Subject:   Re: Count number of linefeeds in a file
Comments:   cc: Bob_Abelson@HGSI.COM

Summary: Don't forget RECFM=N and COUNTC #iw-value=1

Bob,

Consider

filename temp temp ; data _null_ ; infile cards ; input ; file temp ; put _infile_ ; cards ; a b c d e f ; data _null_ ; infile temp recfm=n eof = eof ; input x $char32000. ; cnt + countc(x,"0d"x) ; return ; eof: put cnt= ; return ; run ;

I don't think it would be wise to try to eliminate other characters in this case.

Ian Whitlock ==============

Date: Wed, 21 Nov 2007 09:48:45 -0500 Reply-To: Bob_Abelson@HGSI.COM Sender: "SAS(r) Discussion" From: Bob_Abelson@HGSI.COM Subject: Count number of linefeeds in a file Content-Type: text/plain; charset=us-ascii

Hi folks,

OS is Windows XP, SAS version is 9.1.3.

What I want to do is read in a file (later a bunch of files) and count the number of linefeeds ('0A'x) or carriage returns ('0D'x). Is there a way to strip out everything else, kind of like a complement of COMPRESS?

Thanks.

Bob Abelson HGSI 240 314 4400 x1374 bob_abelson@hgsi.com


Back to: Top of message | Previous page | Main SAS-L page