Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing weird characters (^@)

Status
Not open for further replies.

emilybartholomew

Technical User
Aug 3, 2001
82
US
Hi-

I am currently trying to extract all the data from an Oracle db and upload it into a mysql db. I ran SQL queries in SQL Plus to get all the data, spooling the output to a txt file. Now I'm trying to upload the data into the new db (using a perl script), but there are these weird characters in the data files. Every so often I get these "^@^@^@^@^@^@^@^..." in the data. Is there a way to use a regular expression to get rid of these?!

Thnx
 
That's the null character. You can use
Code:
$string =~ tr/\x00//d;
to strip them out.

jaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top