Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Depending on what you consider a "control character", the below snippets will or won't do what you need :
This will delete all characters with a character code below 32 (space) from the file. Note that also carriage return and linefeed fall under this. And here's the checker to see if your file contains bad characters.
If you want to exclude certain characters from that range (for example CR and LF), you must create the subranges around the characters you don't want. Update: Here are the REs modified to allow CR and LF in your file :
Note that maybe the "wrong" characters also occur, because you are transferring your files via ftp in ASCII mode instead of binary mode (or binary mode instead of ASCII mode) or from an EBCDIC system to an ASCII system or vice versa without the proper conversion.
In reply to Re: VVP:Character code Accusation!
by Corion
|
|