First, I can not re-export this, so I’m stuck with this file.
In the sample posted below, values for an INT column are hexadecimal. I think. Values such as 0X31 need to import as 1. Instead they import as 49. I’m guessing that this might be the ascii equivalent. I need to import 0x31 as 1, 0x32 as 2, etc. How would I do this?
I would also be OK with a text editor that is smart enough to search and replace these values. I have thousands of questionid’s so I don’t want to do this manually e.g. search “0x31” replace with “1”.
Here is the import sample.
REPLACE INTO 'qa_sharedevents' ('entitytype', 'entityid', 'questionid', 'lastpostid', 'updatetype', 'lastuserid', 'updated') VALUES
('Q', '1', 0x31, '1', '', '1', '2012-03-08 23:45:56'),
('U', '1', 0x31, '1', '', '1', '2012-03-08 23:45:56'),
('Q', '1', 0x31, '3', '', '', '2012-03-09 02:23:54'),
('T', '17', 0x31, '1', '', '1', '2012-03-08 23:45:56'),
('Q', '2', 0x32, '2', '', '1', '2012-03-09 01:28:36'),
('U', '1', 0x32, '2', '', '1', '2012-03-09 01:28:36'),
('Q', '2', 0x32, '2', 'E', '1', '2012-03-09 01:30:27'),
('U', '1', 0x32, '2', 'E', '1', '2012-03-09 01:30:27'),
Try the
CHAR()function: