in reply to Replacing charecters in files

I don't think you've provided quite enough information to get a complete answer. Two aspects of your question seem vague to me:

  1. You provide some samples of "special characters" but end it with "etc..." Knowing exactly what you consider to be "acceptable characters" and what you consider to be "special characters" may change the answer a bit.

  2. You say you want to "strip special characters" without "damaging the file information". I would need to know what the resulting output is going to be used for in order to determine if the information is damaged in the stripping process.

On the second point, it may help to provide both a description of what the information is going to be used for and some examples of what your input and desired output should be.

If deleting the special characters damages the information, you may want to encode them or escape them, but the way to do this is highly context dependent.

Without additional information, all I can offer is to add one line to your sample code:

open(INFILE, "$command |"); print "$command -report\n"; while (<INFILE>) { $files = @f[15]; # Delete special characters like ; ' $ ^ $files =~ tr/;'$^//d print OUTFILE "$SQL_insert ('$files');\n"; ... }

-- Eric Hammond