If you have a text file and if you want to Insert data to your Database Table, You can do it with these instructions and screen shots.

1. You should run some sql queries to do it on your server
   In my case :
         server (local) is ==> localhost
         my table is ==> ipbank
         and my text file is ==> ipdata.txt

2. Goto your MYSQL command prompt, I am using phpMyAdmin




3. Then Insert the queries like this

LOAD DATA LOCAL INFILE '/opt/lampp/htdocs/site/ipdata.txt' INTO TABLE ipbank
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'




this is a part of my text document

1358400256,1358400511,AFGHANISTAN
3642070112,3642070127,AFGHANISTAN
3650609920,3650610175,AFGHANISTAN
3650610688,3650611455,AFGHANISTAN
1347305472,1347309567,ALBANIA
3252439552,3252439583,ALBANIA
3254649088,3254649855,ALBANIA
3273049856,3273050111,ALBANIA

so i used   ','   to Terminate the fields
       as   FIELDS TERMINATED BY ','
and I used next line character ' \n ' to terminate the lines
       as LINES TERMINATED BY '\n'

So you can modify the code for your need

** you should pre defined the table with the fields in my case i created the Table like this

CREATE TABLE `myDatabase`.`ipbank` (
`start` INT( 15 ) NOT NULL ,
`end`
INT( 15 ) NOT NULL ,
`country`
INT( 225 ) NOT NULL
)

The End. . . .