HP3000-L Archives

June 2005, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Eben Yong <[log in to unmask]>
Reply To:
Eben Yong <[log in to unmask]>
Date:
Fri, 3 Jun 2005 18:24:06 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (27 lines)
Mark Bixby and other experienced perl programmers on the list could have
done this in a flash, but it took me a couple of hours to figure it out.
In case someone might benefit from this, here's how I did it:

---<code begin>---

# to replace the non printable characters in a file...(with spaces)

$filename = "/AIH/TEMPDATA/PMFEXT";
$fileout = "/AIH/TEMPDATA/PMFEXT2";
open(OUT, ">$fileout");
open(IN, "<$filename");

$_ = <IN>;               #read the first line
s/[^[:print:]]/ /g;
print OUT "$_";

while(<IN>) {               #loop as long as not EOF
s/[^[:print:]]/ /g;
print OUT "$_";
}

---<code end>---

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2