String-how to extract keywords from a string in java and store them in mysql

Source: Internet
Author: User
I read tens of thousands of lines of strings from the txt file and saved them to the string array. the contents in each array are roughly as follows: {& quot; gps & quot ;:{ & quot; type & quot;: & quot; gps & quot;, & quot; Lon & quot;: 116.34948495921601, & quot; status & quot;: & quot; available & quot ;, & quot; Lat & quot;: 39.9621098626166}, & quot; time & quot;: & quot; 2015-11-1119:24:57 mysqlstringjava

I read tens of thousands of lines of strings from the txt file and saved them to the string array. the contents of each array are roughly as follows:
{"Gps": {"type": "gps", "Lon": 116.34948495921601, "status": "available", "Lat": 39.9621098626166}, "time ": "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}]}

What method should I use to extract the content in each {} and store the content in mysql according to the ssid, mac, and dbm respectively?
In addition, the number of {} in each string is not fixed.
Thank you.

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.