Re: use perl to trim out non text characters from a file

2002-09-26 Thread Korthrun
Assuming that you are on a *nix box you can open the file in ex and strip it example: I want to take all the ^M's out of a file. root - local#ex somefile.ext 1,$s/.^M//g[enter] w [enter] of course you have to replace ^M with that crazy acii character. try cutting and pasting if you cant

RE: use perl to trim out non text characters from a file

2002-09-26 Thread david
Tim Booher wrote: > I don't know if they are truly "valid, printable characters". When a text > file show this type of information, isn't ascii just approximating some > binary data? > > Why I think this is if I open with notepad I get a file that looks like > the: ÿÿÿ described earl

RE: use perl to trim out non text characters from a file

2002-09-26 Thread Timothy Johnson
r'; [EMAIL PROTECTED] Subject: RE: use perl to trim out non text characters from a file On Sep 26, Timothy Johnson said: >while(){ > $_ = tr/[^characterclass]//g; > print OUTFILE $_; >} > >putting a ^ at the beginning of a character class matches if the >character is NO

RE: use perl to trim out non text characters from a file

2002-09-26 Thread Jeff 'japhy' Pinyan
On Sep 26, Timothy Johnson said: >while(){ > $_ = tr/[^characterclass]//g; > print OUTFILE $_; >} > >putting a ^ at the beginning of a character class matches if the >character is NOT one of those in the brackets. That's not at all how tr/// works. tr/// ALREADY is a character class operator,

RE: use perl to trim out non text characters from a file

2002-09-26 Thread Timothy Johnson
along those lines if you just want to get rid of non-printable characters. -Original Message- From: Tim Booher [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 6:44 AM To: 'Timothy Johnson' Cc: [EMAIL PROTECTED] Subject: RE: use perl to trim out non text characters f

RE: use perl to trim out non text characters from a file

2002-09-26 Thread Tim Booher
Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 8:36 AM To: 'Tim Booher'; [EMAIL PROTECTED] Subject: RE: use perl to trim out non text characters from a file Someone out there may have a better answer, but this one seems tougher than average becaus

RE: use perl to trim out non text characters from a file

2002-09-26 Thread Timothy Johnson
Someone out there may have a better answer, but this one seems tougher than average because the character you're seeing is a valid, printable text character. I suppose one way to go would be to create a character class with all of the characters that you want to allow. Something like the follow