Main Page | Report this Page
 
   
Linux Forum Index  »  Linux Miscellaneous Topics  »  HELP tr command problem...
Page 1 of 1    
Author Message
Julie Warden...
Posted: Mon Aug 04, 2008 11:30 am
Guest
Group,

I am loading COBOL extracted data into a postgres database. There are
some troublesome characters in the data (CTRL chars,\, and 0x00), and
I wish to filter them out.

I'm using the tr command with the -c option. Here's the command:

tr -c '[:alnum:]|,.-\n' '[ *]' < 1 > 2

I want all alphanumerics, along with the pipe, comma, period, dash,
and newline characters. All other characters are to be replaced with
spaces.

Now the trouble is that pipe delimited files seem to translate just
fine, but comma delimited files have the commas substituted. I've
tried a bunch of stuff, and hit a stone wall.

Running RedHat Enterprise Server release 5.1

TIA,
Julie
Julie Warden...
Posted: Mon Aug 04, 2008 11:49 am
Guest
Group,

It works fine.

Sorry! Didn't pay attention to my path, and was editing the PWD
version of my script, when I was executing the homedir version. Made
the changes to the homedir version and it works and I'm sane.

I'm looking for the newbie hat now. Smile

Humbly yours,
Julie
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Sat Nov 22, 2008 5:34 am