|
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
|