| Date: | Mon, 11 Feb 2008 12:05:18 -0500 |
| Reply-To: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Subject: | Re: Compress out special characters |
|
Susie,
And to expand on Gerhard's recommendation, based on a similar problem
which was faced by another poster last week, you may want to include an
IGNOREDOSEOF option on Gerhard's recommended infile statement. Without
it, you'd never get to see ctrl-Z characters, which also appear as little
squares.
Art
------
On Mon, 11 Feb 2008 10:26:04 -0500, Susie Moyer <smoyer@ITR-LLC.COM> wrote:
>I am reading in an ascii txt file from the internet. I want to compress
>out all characters that are not actual keyboard keys (i.e. not numbers,
>letters, !@#$%^&*(), etc). I believe these charaters I want to compress
>out are for bolding and italics on the web version, but are being kept in
>the ascii text - they are coming through as little boxes if that helps at
>all. Thanks in advance.
Susie,
that might not be enough, what you try to threw out. What you should do is
to analyze, which chars you have really to threw out. Have a closer look
at those little "boxes". You might use:
data _null_;
infile "test.dat";
input;
list;
if _n_>20 then stop;
run;
You'll get each record with ASCII and hex-representation in the log, along
with a ruler to see where you are. You might see, that it is always the
same hex-code you need to COMPRESS out, or TRANSLATE it to " ".
Gerhard
|