Home > Database > Mysql Tutorial > string-新手求解 java 如何从一串字符串中提取关键字,并存入mysql

string-新手求解 java 如何从一串字符串中提取关键字,并存入mysql

WBOY
Release: 2016-06-06 09:35:27
Original
1751 people have browsed it

mysqlstringjava

我从txt文档中读取了大概几万行的字符串,并存入string数组中,每个数组里的内容大概如下
{"gps":{"type":"gps","Lon":116.34948495921601,"status":"available","Lat":39.9621098626166},"time":"2015-11-11 19:24:57+0800","wifi":[{"ssid":"TP-LINK_514","mac":"88:25:93:69:36:d5","dbm":-43},{"ssid":"LiebaoFree150","mac":"5e:4b:d6:d5:b1:31","dbm":-56},{"ssid":"TP-LINK_5G_514","mac":"88:25:93:69:36:d4","dbm":-51},{"ssid":"10-331","mac":"1c:7e:e5:55:22:b6","dbm":-82},{"ssid":"1%ts","mac":"fc:d7:33:7f:51:d8","dbm":-77},{"ssid":"BUPT-dot1x","mac":"d8:c7:c8:02:a1:19","dbm":-85},{"ssid":"516NB","mac":"fc:d7:33:7f:e9:dc","dbm":-70},{"ssid":"Kevin","mac":"f4:b7:e2:b7:0e:25","dbm":-86},{"ssid":"ChinaNet","mac":"2e:4b:d6:ab:5e:2b","dbm":-62},{"ssid":"517","mac":"fc:d7:33:7f:50:30","dbm":-79},{"ssid":"OP","mac":"36:de:1a:71:82:0c","dbm":-78},{"ssid":"BUPT-1","mac":"d8:c7:c8:02:a1:18","dbm":-89},{"ssid":"360WiFi-414","mac":"8c:a9:82:00:8d:03","dbm":-71},{"ssid":"TP-LINK 414","mac":"80:89:17:fd:8e:82","dbm":-82},{"ssid":"TP-LINK_L","mac":"fc:d7:33:80:08:ea","dbm":-90},{"ssid":"211_Class8_SICE_Building5","mac":"ec:88:8f:43:33:d4","dbm":-91},{"ssid":"TP-LINK_1303","mac":"fc:d7:33:80:09:6c","dbm":-87}],"cell":[{"connected":true,"mnc":"46001","cell_type":"gsm_uni","dbm":-79,"m":"one","networktype":"UMTS","cid":7089899,"lac":41052}]}

请问我该用什么方法,把其中每个{}内的内容提取出来,并按照ssid,mac,dbm 分别存入mysql中
而且每串字符串中,{}的数目不固定
谢谢

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template