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:
Ken Hirsch <[log in to unmask]>
Reply To:
Ken Hirsch <[log in to unmask]>
Date:
Sat, 4 Jun 2005 12:35:06 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
That's good, but you don't need to do the first line separately.

Also, for advanced usage, you can do it briefly on the (shell) command line
perl -pe 's/[^[:print:]]/ /g'  /AIH/TEMPDATA/PMFEXT >/AIH/TEMPDATA/PMFEXT2

Eben Yong wrote:

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

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

ATOM RSS1 RSS2