How to convert txt file data to sqlite data

Source: Internet
Author: User
How to convert txt file data to sqlite data
100 of the data calling interfaces of express delivery are used to develop the express delivery query function of the public platform.

  1. $ Kuaidi_data = file_get_contents ("kuaidiinfo.txt ");
  2. $ Sp = explode ("\ n", $ kuaidi_data );
  3. // Var_dump ($ sp );
  4. $ Conut = count ($ sp );
  5. Echo "". $ conut ."
    ";
  6. // $ Code = array ();
  7. // $ Company = array ();
  8. $ Dbname = "data. dat ";
  9. $ Dbh = new PDO ("sqlite:". $ dbname );
  10. $ Create_ SQL = "CREATE TABLE kuaidi (
  11. Id integer primary key,
  12. Code VARCHAR (20) not null,
  13. Company TEXT NOT NULL
  14. )";
  15. $ Dbh-> exec ($ create_ SQL );
  16. For ($ I = 0; $ I <$ conut; $ I ++ ){
  17. $ Kdinfo = explode ("", $ sp [$ I]);
  18. $ Code = $ kdinfo [0];
  19. $ Company = $ kdinfo [1];
  20. // $ Inserte_ SQL = "INSERT INTO kuaidi VALUES ('', '". $ code."', '". $ company ."')";
  21. $ Inserte_ SQL = "INSERT INTO kuaidi ('code', 'Company') VALUES ('". $ code. "','". strtoupper ($ company ). "')";
  22. // $ Inserte_ SQL = "INSERT INTO kuaidi VALUES ('', "fdsfds", "fdsfdsf ")";
  23. Echo $ inserte_ SQL ."
    ";
  24. $ Dbh-> exec ($ inserte_ SQL );
  25. }

  1. Aae Global Delivery
  2. Anjie Express
  3. Anxindakuaixi ainta Express
  4. Biaojikuaidi Express
  5. Bht
  6. Baifudongfang Baifu Oriental International Logistics
  7. Coe China Orient (COE)
  8. Changyuwuliu Changyu logistics
  9. Datianwuliu Datian logistics
  10. Debangwuliu Debang Logistics
  11. Dhl
  12. Dpex
  13. Dsukuaidi d Express
  14. Disifang
  15. EMS Express
  16. Fedex (foreign)
  17. Feikangda
  18. Fenghuangkuaidi Phoenix Express
  19. Feikuaida
  20. Guotongkuaidi Express
  21. Ganzhongnengda Hong Kong Zhongda logistics
  22. Guangdongyouzhengwuliu Guangdong mail logistics
  23. Gongsuda
  24. Huitongkuaidi Express
  25. Hengluwuliu Henglu logistics
  26. Huaxialongwuliu Hua Xialong logistics
  27. Haihongwangsong Haihong
  28. Haiwaihuanqiu overseas
  29. Jiayiwuliu Jiayi logistics
  30. Jinguangsudikuaijian Jingguang Express
  31. Jixianda
  32. Jjwl Jiaji logistics
  33. Jymwl plus US Logistics
  34. Jindawuliu logistics
  35. Jialidatong Kerry Chase
  36. Jykd Express
  37. Kuaijiesudi Express
  38. Lianb FedEx (China)
  39. Lianhaowuliu lianhaotong logistics
  40. Longbanwuliu Longbang logistics
  41. Lijisong send now
  42. Lejiedi lejidi
  43. Minghangkuaidi Express
  44. Meiguokuaidi US Express
  45. Menduimen door-to-door
  46. Ocs
  47. Peisihuoyunkuaidi
  48. Quanchenkuaidi all morning express
  49. Quanfengkuaidi Express
  50. Quanjitong Global Logistics
  51. Quanritongkuaidi all-day Express
  52. Quanyikuaidi all-one Express
  53. Rufengda
  54. Santaisudi three-state express delivery
  55. Shenghuiwuliu Sheng Hui logistics
  56. Shentong
  57. Shunfeng SF
  58. Sue speed logistics
  59. Shengfeng logistics
  60. Saiaodi Saio delivery
  61. Tiandihuayu
  62. Tiantian daily express delivery
  63. Tnt
  64. Ups
  65. Wanjiawuliu Wanjia logistics
  66. Wenjiesudi Wenjie Air Express
  67. Wuyuan
  68. Wxwl Vientiane logistics
  69. Xinbangwuliu Xinbang logistics
  70. Xinfengwuliu Xinfeng logistics
  71. Yafengsudi AirAsia Express
  72. Yibangwuliu Yibang Express
  73. Youshuwuliu
  74. Youzhengguonei zip package registered letter
  75. Youzhengguoji Post international parcel registered letter
  76. Yuanchengwuliu Yuancheng logistics
  77. Yuantong G yuantong Express
  78. Yuanweifeng source Weifeng Express
  79. Yuanzhijiecheng Express
  80. Yunda Express
  81. Yuntongkuaidi Express
  82. Yuefengwuliu Yuefeng logistics
  83. Yad source security
  84. Yinjiesudi Yinjie Express
  85. Zhaijisong home delivery
  86. Zhongtiekuaiyun China Railway Express
  87. Zhongtong Express
  88. Zhongyouwuliu China Mail Logistics
  89. Zhongxinda zhongcinda
  90. Zhimakaimen Zhima opens

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.