Code: Select all
//rawData these are the formats its entered into the DB.. i've changed some of it in a third party editor...
(1115944999)[Thu May 12 18:43:19 2005] You tell george,"hiyas"
//the text I edited in Excel, then uploaded to DB.
1115347805 "You tell george,""hehe"""Code: Select all
CREATE TABLE IF NOT EXISTS `foo` (
`rawData` longtext NOT NULL,
`ID` int(6) unsigned zerofill NOT NULL auto_increment,
PRIMARY KEY (`ID`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;1. Search and pull out the first format
2. change it to the second format
3. take them both, and insert them back into a second DB that will have a third field. (date)
Code: Select all
CREATE TABLE IF NOT EXISTS `foo` (
`rawData` longtext NOT NULL,
`date` varChar(10) NOT NULL,
`ID` int(6) unsigned zerofill NOT NULL auto_increment,
PRIMARY KEY (`ID`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
if(substr($rawData, 0) != "(") {
$rawData = trim(substr($rawData, 10, -1));
$date = rtrim(substr($rawData, 0, 9));
//date1 is only for reporting
$date1 = date('M-D-y', $date);
} else {
$rawData = $row["rawData"];
$date = rtrim(substr($rawData, 1, 10));
//date1 is only for reporting
$date1 = date('M-D-y', $date);
}However the above code refuses to report the correct data, so I have yet to try it on the data base yet.
does any one know how to do what i'm trying to do?
Any help would be really appreciated!!!
(fyi this is for an EQ2 log parser)