How to convert txt file data to sqlite data
Release: 2016-07-25 08:49:25
Original
1291 people have browsed it
The data calling interface of Express 100 is used by me to develop the express query function of the WeChat public platform.
- $kuaidi_data = file_get_contents("kuaidiinfo.txt");
- $sp = explode("n",$kuaidi_data);
- //var_dump($sp);
- $conut = count( $sp);
- echo "".$conut."
";
- //$code = array();
- //$ company = array();
- $dbname = "data.dat";
- $dbh=new PDO("sqlite:".$dbname);
- $create_sql = "CREATE TABLE kuaidi(
- id INTEGER PRIMARY KEY,
- code VARCHAR (20) NOT NULL,
- company TEXT NOT NULL
- )";
- $dbh->exec($create_sql);
-
- for($i=0;$i<$conut;$i++){
- $kdinfo = explode(" ",$sp[$i]);
- $code = $kdinfo[0];
- $company = $kdinfo[1];
-
- //$inserte_sql = "INSERT INTO kuaidi VALUES('',' ".$code."','".$company."')";
- $inserte_sql = "INSERT INTO kuaidi (`code`,`company`) VALUES('".$code."','". strtoupper($company)."')";
- //$inserte_sql = "INSERT INTO kuaidi VALUES('',"fdsfds","fdsfdsf")";
- echo $inserte_sql."
";
- $dbh->exec($inserte_sql);
- }
-
-
Copy code
- aae aae global express
- anjie Anjie Express
- anxindakuaixi Anxinda Express
- biaojikuaidi Biaoji Express
- bht bht
- baifudongfang Baifu Oriental International Logistics
- coe China Eastern (COE)
- changyuwuliu Changyu Logistics
- datianwuliu Datian Logistics
- debangwuliu Debon Logistics
- dhl dhl
- dpex dpex
- dsukuaidi d express express
- disifang delivery to all directions
- ems ems express
- fedex fedex (overseas)
- feikangda Feikangda Logistics
- fenghuangkuaidi Phoenix Express
- feikuaida Feiquaida
- guotong kuaidi Guotong Express
- ganzhongnengda Hong Kong China Nengda Logistics
- guangdongyouzhengwuliu Guangdong Post Logistics
- gongsuda Gongsuda
- huitongkuaidi Huitong Express
- hengluwuliu Henglu Logistics
- huaxialongwuliu Huaxialong Logistics
- haihongwangsong Haihong
- haiwaihuanqiu Overseas Global
- jiayiwuliu Jiayi Logistics
- jin guangsudikuaijian Beijing-Guangzhou Express
- jixianda Jixianda
- jjwl Jiaji Logistics
- jymwl Jiayunmei Logistics
- jindawuliu Jinda Logistics
- jialidatong Kerry Chase
- jykd Jinyue Express
- kuaijiesudi Express Express
- lianb FedEx (domestic)
- lianhaowuliu Lianhaotong Logistics
- longbanwuliu Longbang Logistics
- lijisong Send now
- lejiedi Lejie Express
- minghangkuaidi Civil Aviation Express
- meiguokuaidi American Express
- menduimen door to door
- ocs OCS
- peisihuoyunkuaidi Peisi Freight
- quanchenkuaidi Quanchen Express
- quanfengkuaidi Quanfeng Express
- quanjitong Quanjitong Logistics
- quanritongkuaidi Quan Nippon Express
- quanyikuaidi Quanyi Express
- rufengda Rufengda
- santaisudi Sanzhou Express
- shenghuiwuliu Shenghui Logistics
- shentong STO
- shunfeng SF Express
- sue Suer Logistics
- shengfeng Shengfeng Logistics
- saiaodi Saiaodi
- tiandihuayu Tiandi Huayu
- tiantian Tiantian Express
- tnt tnt
- ups ups
- wanjiawuliu Wanjia Logistics
- wenjiesudi Wenjie Air Express
- wuyuan Wuyuan
- wxwl Vientiane Logistics
- xinbangwuliu Xinbang Logistics
- xinfengwuliu Xinfeng Logistics
- yafengsudi Yafeng Express
- yibangwuliu Yibang Express
- youshuwuliu Yousu Logistics
- youzhengguonei Postal parcel registration Letter
- youzhengguoji Post International Parcel Registered Mail
- yuanchengwuliu Yuancheng Logistics
- yuantong Yuantong Express
- yuanweifeng Yuanweifeng Express
- yuanzhijiecheng Yuanzhijiecheng Express
- yunda Yunda Express
- yuntongkuaidi Express Express
- yuefengwuliu Yuefeng Logistics
- yad Yuan Anda
- yinjiesudi Yinjie Express
- zhaijisong Home Delivery
- zhongtiekuaiyun China Railway Express
- zhongtong Zhongtong Express
- zhongyouwuliu China Post Logistics
- zhongxinda Zhongxinda
- zhimakaimen Open Sesame
Copy code
|
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31