2011-04-04 17 views
0

複雑なCSVファイルを解析したいと思います。私はウェブ上のソースを検索したが、昏睡と引用符付きのシンプルなCSVの読者しか見つけなかった。しかし、鉱山には、グループ、サブグループを作成するために "{"、 "["と ":"が含まれています...iPhone:複雑なCSVパーサー

この種のcsvからNSArrayまたはNSDictionaryを取得するにはどうすればよいですか? あなたは素晴らしい(素晴らしい!)csvリーダー/パーサーを知っていますか?

ありがとうございます!ここ

例である:

{ "メタ":{ "コード":200}、 "応答":{ "グループ":[{ "タイプ": "近く"、 "名前" : "√" "近接" "アイテム":[{"" id ":" 4bc88ad72f94d13aa9c5137f "、"名前 ":" Moth©Trand Chauss©©d'Antin-La Fayette [7,9] "、" contact ":{}、" location ":{"住所 ":" Fayette "、" city ":" Paris "、" state ":" "距離":39 "、"カテゴリ ":[{" "id": "4bf58dd8d48988d1fd931735"、 "lang":4833006 " 「名前」:「地下鉄」、「アイコン」:「ht 「確認」:偽、「統計」:{tp://foursquare.com/img/categories/travel/subway.png "、" parents ":[" Travel スポット "]、"プライマリ " "count":0}}、{"id": "4ba8e508f964a520e4f739e3"、 "名前": "AdenClassifieds"、 "連絡先":{}、 "チェックインカウント":885、 "usersCount" "location":{"address": "1-rue La Fayette"、 "city": "Paris"、 "state": "フランス"、 "postalCode": "75009"、 "lat":48.8733461、 "lng":2.3340489、 "距離":50}、 "カテゴリ":[{"" id ":" 4bf58dd8d48988d124941735 "、"名前 ":"オフィス "、"アイコン ":" http://foursquare.com/img/ {"checkinsCount":187、 "categories/building/default.png"、 "parents":[家、 仕事、 その他]、 "プライマリ" "名前:" "AdenSourcing"、 "連絡先:":{}、 "location":{"}"、 "hereCow"住所: "1、 rue La Fayette "city": "Paris"、 "state": "France"、 "postalCode": "75009"、 "lat":48.873009、 "lng":2.333263、 "distance":28}、 "categories":[ {"id": "4bf58dd8d48988d125941735"、 "名前": "Tech スタートアップ"、 "アイコン": "http://foursquare.com/img/categories/building/default.png"、 "parents":["家、 "Work、 "、 "Offices"]、 "primary":true}、{"id": "4bf58dd8d48988d174941735"、 "name": "Coworking スペース"、 "アイコン": "http:// foursquare。 } "、"確認済み ":false、" stats ":{" checkinsCount ":"家 "、"仕事、 その他 "、"オフィス "]} 60、 "usersCount":7}、 "hereNow":{"count":0}}、{"id": "4b6d79c2f964a520f6762ce3"、 "name": "Not©gatif +"、 "contact" "location":{"住所": "rue lafayette"、 "city": "Paris"、 "state": "フランス"、 "postalCode": "75010"、 "lat":48.873035、 "lng" 2.333 235、 "距離":26}、 "カテゴリ":[{"" id ":" 4bf58dd8d48988d1ff941735 "、"名前 ":"その他 ショップ "、"アイコン ":" http://foursquare.com/img/categories/ {"checkinsCount":121、 "usersCount":51} "、" {{checkinsCount ":121、" stores/default.png "、" parents " "" {"count":0}}、{"id": "4beeb21a2c082d7f96b53042"、 "name": "Sephora Haussmann"、 "contact":{}、 "location":{"住所": "23 フランス語、フランス語、ラテン語:48.8728835、 "lng":2.3334661、 "distance":41}、 "categories":[{bd Hausmann "、" city " "id": "4bf58dd8d48988d10c951735"、 "name": "Cosmetics ショップ"、 "icon": "http://foursquare.com/img/categories/shops/beauty_cosmetic.png"、 "parents":["ショップ" {"count":0}}、{"id"}、 "primary":true}]、 "検証済み":false、 "stats":{"checkinsCount":135、 "usersCount":75} ":" 4af55e08f964a520f3f821e3 "、"名前 ":" Chez ジーン "、"連絡先"、" location ":" {"address": "4 rue La Fayette"、 "city": "Paris"、 "state": "フランス"、 "postalCode": "75009"、 "lat" :48.8731558、 "lng":23334978、 "距離":13}、 "カテゴリ":[{"id": "4bf58dd8d48988d118951735"、 "名前": "グロサリー 店舗"、 "アイコン": "http://foursquare.com/img/categories/ {"checkinsCount":46、 "shop/food_grocery.png"、 "parents": "ショップ"、 "飲食店 ショップ"、 "primary" "名前:" H & M "、"連絡先 ":{}、"場所 ":"ユーザーカウント ":27}、" hereNow ":{"カウント ":0}}、{" id ":" 4bee9a52e8c3c928dfd89892 " {"id": "4bf58dd8d48988d104951735"、 "名前": "ブティック"、 "アイコン": "http://" /foursquare.com/img/categories/shops/apparel.png","parents":["Shops","Clothing Stores "、" primary ":true}]、" verified ":false、" stats ": {"id": "4bindd04df964a520865627e3"、 "名前": "Surcouf"、 "連絡先":{} "{countinsCount":84、 "usersCount":66}、 "hereNow" 、 "location":{"address": "21、 bd Haussmann"、 "city": "パリ "、"国 "、"フランス "、"ポストコード ":" 75009 "、"ラト ":48.8728008、" lng ":2.3339615、"距離 ":65}、"カテゴリ ":[{" id ":" 4bf58dd8d48988d122951735 "、" name ":" High Tech アウトレット "、"アイコン ":" http://foursquare.com/img/categories/shops/technology.png "、" parents ":["ショップ "]、"プライマリ " {"count":0}}、{"id": "4b1e6795f964a5209a1924e3": "true"} "検証済み":false、 "stats":{"checkinsCount":332、 "usersCount":194}、 "hereNow" "、" name ":" Le Manoir "、" contact ":{}、" location ":{"住所 ":" 34 大通り オースマン "、"都市 ":"パリ "、"州 ":"フランス"、" postalCode ":" 75009 "、" lat ":48.872964707066394、" lng ":2.334015369415283、" distance ":56}、" categories ":[{" id ":" 4bf58dd8d48988d16d941735 "、" name ":"Caf√ 「親」:[「食品」]、「プライマリ」:真}]、「検証済み」: false、 "stats":{"checkinsCount":116、 "usersCount":61}、 "hereNow":{"count":0}}、{"id" : "住所": "Rue ラファイエット"、 "パリ"、 "州": "4cb59ee81b0af04dca42ca25"、 "名前": "Casa Del カンポ"、 "連絡先" : "Ile-de-France"、 "lat":48.873035、 "lng":2.333235、 "distance":26}、 "categories":[{"id": "4bf58dd8d48988d1db931735"、 "name": "Tapas "、" parent ":[" Food "]、" primary ":true}]、" verified ":false、 "stats":{"checkinsCount":12、 "usersCount":11}、 "hereNow":{"count":0}}、{"id": "4cdd43c0d5495481874446b2"、 "name": "Thalys Paris> フランス語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、ポルトガル語、 : "75011"、 "lat":48.873035、 "lng":2.333235、 "distance":26}、 "categories":[{"id": "4bf58dd8d48988d12a951735"、 "name": "Trains"、 "icon" "http://foursquare.com/img/categories/travel/trainstation.png"、 "parents":["Travel スポット"、 "Train 駅"、 "primary":true}] "確認済み": false "、" stats ":{" checkinsCount ":5、" usersCount ":5}、" hereNow ":{" count ":0}}、{" id ":" 4ba3d477f964a520226438e3 "、" name ":" Les Diamantaires "、"連絡先 ":{}、"場所 ":{"住所 ":" 60、 Rue ラファイエット "、"都市 ":"パリ "、"州 ":"イルドフランス "、" postalCode " : "75009"、 "lat":48.873035、 "lng":2.333235、 "distance":26}、 "categories":[{"id": "4bf58dd8d48988d115941735"、 "name": "Middle Eastern レストラン" "icon": "http://foursquare.com/img/categories/food/middleeastern.png"、 "parents":["Food"]、 "primary":true}]、 "verified":false、 "stats ":" "{" count ":0}}、{" id ":" 4cbeb94297bc721e31158167 "、" name ":" Dentiste "、" contact ":" checkinsCount ":11、" usersCount ":10} {}、"ロケーション":{ "住所": "36 bd haussmann"、 "city": "Paris"、 "state": "Ile-de-France"、 "lat":48.8729985、 "lng":2.3331688、 "distance":31} "カテゴリ":[{"" id ":" 4bf58dd8d48988d178941735 "、"名前 ":"歯科医の オフィス "、"アイコン ":" http://foursquare.com/img/categories/building/medical_dentist.png "、" 「確認」:偽、「統計」:{"checkinsCount":9、 "usersCount":2} "親":["家、 仕事、その他"、 "医療 センター" } "、" hereNow ":{" count ":0}}、{" id ":" 4c098514bbc676b0365c48d5 "、" name ":" " "lat":48.872859、 "lng":2。"" checkinsCount ":36、" usersCount ":21}、" hereNow ":{" count ":0}、"距離 ":43}、"カテゴリ ":" 「住所」:「 rue La Fayette」、「city」、「city」、「city」、「city」、 : "パリ"、 "国"、 "フランス"、 "郵便番号": "75009"、 "ラト":48.8733461、 "lng":2.3340489、 "距離":50}、 "カテゴリ":[{"id" "4bf58dd8d48988d110941735"、 "名前": "イタリア語 レストラン"、 "アイコン": "http://foursquare.com/img/categories/food/default.png"、 "parents":["Food"]、 "primary {"count":0}}、{"id": "4be11bf20f03a593908e18b4"、 "checkedCount":62、 "usersCount":47} 」、 "名前": "ポール 方向NVX メディアシュ"、 "接触":{}、 "場所":{ "LAT":48.872878、 "LNG":2.333277、 "距離":42}、 "カテゴリ": []、 "検証済み":偽、 "統計":{"checkinsCount":25、 "usersCount":6} 、 "hereNow":{"count":0}}、{"id": "4c17d044834e2d7f94f02780"、 "name": "Josefin"、 "contact":{}、 "location":{"city": "Paris" "location": "Ile-de-France"、 "lat":48.872863、 "lng":2.333273、 "distance":43}、 "categories":[{"id": "4bf58dd8d48988d10c941735"、 "name" "フレンチ レストラン"、 "アイコン": "http://foursquare.com/img/categories/food/default.png"、 "parents":["Food"]、 "primary":true}]、 "verified ":" false "、" statins ":{" checkinsCount ":14、" usersCount ":8}、" hereNow ":{" count ":0}}、{" id ":" 4b597cfcf964a520e68928e3 "、" name ":" Siege ダーノン "、"連絡先 ":{}"場所 ":{"住所 ":" 17 大通り "、"都市 ":"パリ " ":59}、" categories ":[{" id ":" 4bf58dd8d48988d124941735 "、"名前 ":"オフィス "、"アイコン ":" http://foursquare.com/img/categories/building/default.png " 、 "parents":["Homes、 Work、 その他"]、 "primary":true}]、 "verified ":" false "、" statins ":{" checkinsCount ":23、" usersCount ":13}、" hereNow ":{" count ":0}}、{" id ":" 4c1f5058fcf8c9b6f66bae0b "、" name ":" Obene 」、 "接触":{}、 "場所":{ "アドレス": "35 RUE聖人 lazarre"、 "都市": "パリ"、 "状態": "Francr"、 "postalCodeの": "75009" "lat":48.872829、 "lng":2.333201、 "距離":48}、 "categories":[{"id": "4bf58dd8d48988d1c0941​​735"、 "名前": "地中海料理 レストラン"、 "アイコン":http : ""; "": ""、 "": ""、 "": "" :21、 "usersCount":5}、 "hereNow":{ "カウント":0}}、{ "ID": "4d5133ac9ffc236a026720a7"、 "名前": "ソファー カフェ メーカー"、 "接触":{} 、 "場所":{ "LAT":48.873568、 "LNG":2.33384、 "距離":48}、 "カテゴリ":[{ "ID": "4bf58dd8d48988d10c941735"、 "名前": "フレンチ レストラン"、」アイコン ":" http://foursquare.com/img/categories/food/default。 {"checkinsCount":11、 "usersCount":10}、 "hereNow":{"}"、 "parents" "count":0}}、{"id": "4cfa4adf2d80a1438a9f43d8"、 "name": "Manucurist"、 "contact":{}、 "location":{"住所": "Rue de la chausse d antin "city": "Paris"、 "state": "Ile-de-France"、 "lat":48.87294352054596、 "lng":2.333693504333496、 "distance":41}、 "categories":[{"id" : ""、 "名前:": "化粧品 店"、 "アイコン": "http://foursquare.com/img/categories/shops/beauty_cosmetic.png"、 "両親":["ショップ"]: "4bf58dd8d48988d10c951735" {"count":0}}、{"id": "}"、 "確認済み":false、 "stats":{"checkinsCount":28、 "usersCount":4}、 "hereNow" {0} "、" location ":{" lat ":48.872853、" lng ":2.333072、" distance ":49}、"カテゴリ "、"名前: "、"名前 ":" Le Galfa - La フェイエット " ":[{" id ":" 4bf58dd8d48988d10c941735 "、" name ":"フランス語 Re "parent":["Food"]、 "primary":true}]、 "verified":falseのいずれかを指定します。 {"count":0}}、{"id": "4c124b6377cea59338bccc60"、 "name": "Noon"、 "接触 ":{}、" 場所 ":{" アドレス ":" ルー ラショッセD アンティン」、 "都市": "パリ"、 "状態": "イルドフランス"、 "" LAT。 48.8736428、 "lng":2.3330026、 "distance":51}、 "categories":[{"" id ":" 4bf58dd8d48988d146941735 "、" name ":" Delis または Bodegas "、" icon ":" http:// foursquare.com/img/categories/food/deli。{"checkinsCount":15、 "usersCount":12}、 "hereNow":{"checkinsCount":{"checkinsCount" "count":0}}、{"id": "4bb2f78ea32876b0173a01fe"、 "name": "Glam メディアFrance(temp オフィス)"、 "contact":{}、 "location":{"address": "bd Haussman "、" city ":" Paris "、" lat ":48.87305、" lng ":2.333831、" distance ":39}、" categories ":[{" "id": "4bf58dd8d48988d125941735"、 "name ":" Tech スタートアップ "、"アイコン ":" http://foursquare.com/img/categories/building/default.png "、" parents ":["家、 仕事、 その他 "、"オフィス " {"count":0}}、{"id"}、{"count":0}}、 "primary":true}]、 "検証済み":false、 "stats":{"checkinsCount":7、 "usersCount" ":" 4c122cd7583c9c74bf323fa4 "、" name ":" Havaianas 夏のギャラリー@ ラファイエット "、"連絡先 ":{"電話 ":" 014282345 6 "、" twitter ":" havaianaseurope "}、" location ":{"住所 ":" 4 boulevard Haussmann "、" city ":" 75009 パリ "、"州 ":"フランス "、"国 " 「靴」 「店」、「アイコン」、「靴」、「靴」、「靴」、「靴」、 : "http://foursquare.com/img/categories/shops/apparel.png"、 "parents":["ショップ"、 "衣類 ストア"、 "プライマリ":true}]、 "確認済み":true "" counts:0 "}、{" id ":" 4b9a40c4f964a52081a735e3 "、" name ":" little ジョージタッテ " "location":{"lat":48.872544、 "lng":2.33322、 "distance":79}、 "categories":[{"" id ":" 4bf58dd8d48988d10c941735 "、" name ":" "フレンチ レストラン"、 "アイコン": "http://foursquare.com/img/categories/food/default.png"、 "parents":["Food"]、 "primary":true}]、 "verified ":false、" stats ":{" checkinsCount ":60、" users Count ":41}、" hereNow ":{" count ":0}}、{" id ":" 4c319736213c2d7f5e33345d "、" name ":" Isiom "、" contact ":{}、" location ":{" lat ":48.872815、" lng ":2.333228、" distance ":49}、" categories ":[{" "id": "4bf58dd8d48988d124941735"、 "name": "Offices"、 "icon": "http:// foursquare。 ""、 "確認":偽、 "統計":{"checkinsCount"、 "/"/" ":7、" usersCount ":2}、" hereNow ":{" count ":0}}、{" id ":" 4c89f5e49ef0224b0595567b "、" name ":" Cardiweb "、" contact ":{}、" location ":" {都市 ":"パリ "、"国 "、"イル=フランス "、"ラト ":48.873727、" lng ":2.33362、"距離 ":55}、"カテゴリ ":[{" id ":" 4bf58dd8d48988d124941735 "、"名前 ":"オフィス "、"アイコン ":" http://foursquare.com/img/categories/building/default.png "、" parents ":[" Homes、 Work、 false "、" stats ":{" checkinsCount ":5、" usersCount ":3}、" hereNow ":{" count ":0}}、{else} "id": "4c507cf7991c20a18e0147 「location」:{"lat":48.872982、 "lng":2.33353、 "distance":31}、 "categories":[{"、" name " "id": "4bf58dd8d48988d124941735"、 "名前": "オフィス"、 "アイコン": "http://foursquare.com/img/categories/building/default.png"、 "parents":["家、 仕事、 "0"}、 "hereNow":{"countins:0}}"、 "first": "}"、 "確認済み":false、 "stats":{"checkinsCount":1、 "usersCount" ]}]}}

答えて

5

これはCSVではなくJSONのようです。このJSONフレームワークを使用してファイルを解析します:http://code.google.com/p/json-framework/

+0

私はそんなにばかげています....たくさんのthaknsたくさん – Bejil

+1

[ここ](http://chris.photobooks.com/json/default.htm)です本当に良いオンラインJSON視覚化ツールです。 JSONテキストにペーストして「レンダリング」を押すと、全体を何が含まれているかに分けて表示され、理解しやすくナビゲートしやすくなります。 –

+0

すごく便利です! – Bejil

関連する問題