Nate said:
>Okay, the double quotes come from the CD-ROM and the only way to change
>them is with a bunch of string mangling.  I'm reluctant to do so since
>each data file is on the order of 2 MB or more.  Since my script and
>SQLite didn't seem to notice the difference except for the
>aforementioned '?"' problem.
>
>The single quoted text came from the .dump command in sqlite as I was
>trying to show a before and after of the data I have to work with.  I
>realize I should have been more clear.
>
>If I need to change the double quote characters to single quote
>characters when processing the data file, I will then need to escape
>every apostrophe that is embedded in the string as well, right?

As long as you think each file is consistently formatted, I would do something like 
this:

$insert_sql_str = read_from_cd_file();
$insert_sql_str =~ s/'/''/g; # escape existing single quotes
$insert_sql_str =~ s/"/'/g; # convert doubles to singles
execute_sql_against_db( $insert_sql_str );

That does your mangling concisely, then.

-- Darren Duncan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to