Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 1 0.008 0 0 0 0 0
- LOAD DATA INFILE 'filename' INTO TABLE mytable FIELDS TERMINATED BY ' ';
- sed 's/ +/ /g' thefile > thefile.new
- <?php
- $db = mysql_connect('host', 'user', 'password')
- or die('Failed to connect');
- mysql_select_db('database', $db);
- $fileHandle= @fopen("import.file", "r");
- if ($fileHandle) {
- while (!feof($fileHandle)) {
- $rawLine = fgets($fileHandle, 4096);
- $columns = preg_split("/s+/", $rawLine);
- //Construct and run an INSERT statement here ...
- }
- fclose($fileHandle);
- }
- ?>
- LOAD DATA INFILE 'filename' INTO TABLE mytable FIELDS TERMINATED BY ',';
Add Comment
Please, Sign In to add comment