Ask a Question related to PERL Modules, Design and Development.
-
Ralph Noble #1
Removing non-printing characters ...
Folks ... I have a pipe-delimited ASCII text file with a lot of
different non-printing characters. Rather than try and figure out all
the non-printing characters that exist in this 17+ million record
database, I was hoping someone might have already written a script or
know of a module they'd be willing to share that would remove all
non-printing characters from an ASCII file?
Thanks,
Ralph Noble
[email]ralph_noble@hotmail.com[/email]
Ralph Noble Guest
-
Removing special characters from a string
What's the best way to remove special characters from a string leaving just alphanumeric characters and spaces ??? -
Removing characters out of a field
I have a search screen and the user will be entering an isbn number to search. Some users will enter dashes and others will not. My database field... -
Characters looking jumbled when printing
Hi Guys, we have recently sent a pdf file to a client which opens up fine for us and prints for us, when the client opens the file it looks great on... -
Finding non-printing characters in data
HP-UX 11.0 IDS 9.21.HC4 Just wondering if there is a simple way to find non-printing characters embedded in char fields. I have tried to... -
Removing characters once a series stops
I have strings that I need to get the first set of numbers from. IE: ABC123DEF ABC11JH8KLZ I need to get 123 and 11 from the from the above... -
Jürgen Exner #2
Re: Removing non-printing characters ...
Ralph Noble wrote:
Oh my, that's difficult. you need one whole command:> Folks ... I have a pipe-delimited ASCII text file with a lot of
> different non-printing characters. Rather than try and figure out all
> the non-printing characters that exist in this 17+ million record
> database, I was hoping someone might have already written a script or
> know of a module they'd be willing to share that would remove all
> non-printing characters from an ASCII file?
s/[:^print:]//g;
Further details see "perldoc perlre", section " The POSIX character class
syntax".
Reading the file and writing back the modified text is left as an exercise.
jue
Jürgen Exner Guest
-
Brian McCauley #3
Re: Removing non-printing characters ...
Ralph Noble wrote:
perl -pe 's/[[:cntrl:]]+//g'> Folks ... I have a pipe-delimited ASCII text file with a lot of
> different non-printing characters. Rather than try and figure out all
> the non-printing characters that exist in this 17+ million record
> database, I was hoping someone might have already written a script or
> know of a module they'd be willing to share that would remove all
> non-printing characters from an ASCII file?
(Note this removes all nonprinting characters including the linebreaks
too - is that really what you wanted?)
perl -lpe 's/[[:cntrl:]]+//g'
Brian McCauley Guest
-
Brian McCauley #4
Re: Removing non-printing characters ...
Jürgen Exner wrote:
Surely you mean> s/[:^print:]//g;
s/[^[:print:]]+//g;
Right back at you J! :-)> Further details see "perldoc perlre", section " The POSIX character class
> syntax".
Brian McCauley Guest
-
Jürgen Exner #5
Re: Removing non-printing characters ...
Brian McCauley wrote:
Hmmmm, indeed ;-((> Jürgen Exner wrote:
>>>> s/[:^print:]//g;
> Surely you mean
>
> s/[^[:print:]]+//g;
>>>> Further details see "perldoc perlre", section " The POSIX character
>> class syntax".
> Right back at you J! :-)
jue
Jürgen Exner Guest
-
Mary Pastore #6
Re: Removing non-printing characters ... Does this remove newlines too?
It shouldn't right? I tried using this and piping to output file, but for some reason, it returns one long line instead of my original format with many lines.
Junior Member
- Join Date
- Dec 2010
- Posts
- 1



Reply With Quote

