Remove Whitespace using Perl

If you need to remove white space from say a CSV file that has been spooled by SQLPLUS, then try this:

 perl -pi.bak -e "s/^ *//g;s/ *,/,/g;s/, */,/g" C:\working\Batch\spooled_output.csv

This will remove leading spaces and any spaces in between comma separated values.

It will also create a *.bak file of your original.

 

ODBC TNSNAMES Dropdown Gobbledygook and windings

On Windows 7 ODBC Administrator, if you add a new Oracle connection in System DSN, and the TNS Selector shows a list of gobbledygook or Windings, then check your %TNS_ADMIN% System Environment Variable.

Chances are it is not pointing to where the Network/Admin directory is (ie where your tnsname.ora is located).

Simply update with the correct path and you’re sorted.

(right click computer, Properties->Advanced System Settings->Environment Variables->System Variables)