Page 1 of 1

Escape characters

Posted: Tue Feb 12, 2008 6:08 pm
by Andycal
Righty ho, nearly there!

I'm currently writing an application that takes some files and creates an SQL file that I can use to get the data into a database.

So far, all's going well and thanks to the guys here for the help - couldn't have done it without either RunRev or your help!

Anyway, at the final fence now and I'm outputting to a file, thing is, some of my text files have apostrophes and quotes in them, so when the sql file is written, it breaks when running it.

I'm using MySQL so it requires a backslash in front of any quotes in order to escape them and I was wondering if there's a way of doing this easily within RunRev.

I tried:

Code: Select all

replace "'" with "''" in wRest
But that didn't work (didn't really expect it to).

Any ideas?

Posted: Tue Feb 12, 2008 6:12 pm
by Andycal
Actually, the single quotes did work, the doubles don't:

Code: Select all

replace """ with """" in wRest

Posted: Tue Feb 12, 2008 6:26 pm
by malte
try

replace quote with quote&quote in wRest

All the best,

malte

Posted: Tue Feb 12, 2008 8:01 pm
by Andycal
!!!WHOOP!!!

Thanks buddy, now finally completed my first proper RunRev app!!

Beers all round!