title: windows cmd to copy the text between two points in a .sql file and write to another .sql File
body: <p>There is this mySQL dump file(file.sql) with the table structures and insert statements for a database.</p>
  <pre><code>--DO NOT COPY
  --DO NOT COPY
  -- Table structure for table `address`
  --
  
  DROP TABLE IF EXISTS `address`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `address` (
  `ENCODEDKEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `ADDRESSTYPE` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT 
  NULL,
  `CITY` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `address`
  --
  
   LOCK TABLES `address` WRITE;
  /*!40000 ALTER TABLE `address` DISABLE KEYS */;
  INSERT INTO `address` VALUES ( 'ENCODEDKEY','ADDRESSTYPE','CITY');
  /*!40000 ALTER TABLE `address` ENABLE KEYS */;
  UNLOCK TABLES;
  --DO NOT COPY
  --DO NOT COPY
  </code></pre>
  <p>I want to copy the text from this file.sql between two points which is a starting point to a ending point.</p>
  <p>The starting point should be the exact string of =</p>
  <blockquote>
  <p>Table structure for table 'find_tablename'</p>
  </blockquote>
  <p>The ending point should be exact string of =</p>
  <blockquote>
  <p>UNLOCK TABLES;</p>
  </blockquote>
  <p>And I want to copy/read all the text between those 2 points and write to a new .sql file</p>
  <p>This Unix command using SED does the task:</p>
  <pre><code>sed -n -e '/-- Table structure for table `address`/,/UNLOCK TABLES/p' file.sql &gt; new_file.sql
  </code></pre>
  <p>However i am looking for the windows equivalent using the command line(cmd). I started to do this with the @type command but I need some sort of IF statement to tell the process to only copy all the text between those 2 points and write to a new .sql file.</p>
  <pre><code>@type C:\Users\Documents\file.sql &gt; C:\Users\Documents\new_file.sql
  </code></pre>