review these:
magic_quotes_runtime
magic_quotes_gpc
addslashes()
stripslashes()
strip_tags()
htmlspecialchars()
Find the right combo for your environment and you are happenin =)
If the data is coming from a text file you can write a quickie script to pull the text file in and format it using some of the above functions and then output it as INSERT statements.
No doubt there are even easier ways to do this but that's what I usually do.