



The BEGIN section is executed first, then for each line of the input file, the body section is executed. The awk file contains three major sections. I was hoping a few regular expressions might do the trick. You can count on awk being a universally available text processing tool on any linux environment, so I decided to give an awk-based approach a shot. One global header file, and a set of two files for each table: a SQL file containing the table definition statements, and a CSV file containing the data. I decided to try and slice this file into individual pieces. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!40101 SET character_set_client = */ - Dumping data for table `borders` - LOCK TABLES `borders` WRITE /*!40000 ALTER TABLE `borders` DISABLE KEYS */ INSERT INTO `borders` VALUES ('A','D',784).,('ZW','Z',797) /*!40000 ALTER TABLE `borders` ENABLE KEYS */ UNLOCK TABLES. drop database if exists mondial create database mondial use mondial - Table structure for table `borders` - DROP TABLE IF EXISTS `borders` /*!40101 SET = */ /*!40101 SET character_set_client = utf8 */ CREATE TABLE `borders` ( `Country1` varchar(4) NOT NULL DEFAULT '', `Country2` varchar(4) NOT NULL DEFAULT '', `Length` int(11) DEFAULT NULL. It looks something like this: - MySQL dump 10.13 Distrib 5.5.25a, for Win64 (x86) - Host: localhost Database: mondial - Server versionĕ.5.25a /*!40101 SET */. Have a look at the mysql-dump of the mondial database to get the idea. Some additional non-data statements like table locking are bracketed around the data inserts.
