Subject: | |
From: | |
Reply To: | |
Date: | Sat, 4 Jun 2005 12:35:06 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
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 *
|
|
|