Skip to content

Instantly share code, notes, and snippets.

@hsiboy
Created March 6, 2014 22:51
Show Gist options
  • Save hsiboy/9401494 to your computer and use it in GitHub Desktop.
Save hsiboy/9401494 to your computer and use it in GitHub Desktop.
import data into mysql
@echo off
IF EXIST load.sql echo. > load.sql
for /f %%a IN ('dir /b *_iewpg.txt') do (
echo %%a
echo load data LOCAL infile '%%a' into table iewpg fields terminated by '\t' lines terminated by '\n'; >>load.sql
)
for /f %%a IN ('dir /b *_iewtr.txt') do (
echo %%a
echo load data LOCAL infile '%%a' into table iewtr fields terminated by '\t' lines terminated by '\n'; >>load.sql
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment