- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试将 MySQL 世界数据库转换为缩进格式以用于 Drupal Taxonomy Manager .我有一个平面电子表格格式的层次结构:world_hierarchy.xlsx .
我需要以这种格式输出该文件的层次结构:
Region
-Continent
--Country
---City
所以树的随机样本看起来像这样:
Central America
-North America
--Panama
---San Miguelito
Eastern Africa
-Africa
--British Indian Ocean Territory
--Ethiopia
---Nazret
任何节点都不应在树中出现超过一次(例如,Central America 应该只出现一次,其子节点也应效仿。
最佳答案
我最终使用按大陆排序电子表格并切掉地区和城市(我将使用自动完成保留这个开放式,以便用户可以添加他们的城市。我使用分类法中的“导出到 CSV”功能导出结构经理模块并想出了这个(分号分隔):
"5";"364";"Africa";"";"0"
"5";"394";"Algeria";"";"364"
"5";"365";"Angola";"";"364"
"5";"406";"Benin";"";"364"
"5";"401";"Botswana";"";"364"
"5";"374";"British Indian Ocean Territory";"";"364"
"5";"407";"Burkina Faso";"";"364"
"5";"375";"Burundi";"";"364"
"5";"366";"Cameroon";"";"364"
"5";"408";"Cape Verde";"";"364"
"5";"409";"Côte d’Ivoire";"";"364"
"5";"367";"Central African Republic";"";"364"
"5";"368";"Chad";"";"364"
"5";"376";"Comoros";"";"364"
"5";"369";"Congo";"";"364"
"5";"370";"Congo, The Democratic Republic of the";"";"364"
"5";"377";"Djibouti";"";"364"
"5";"395";"Egypt";"";"364"
"5";"371";"Equatorial Guinea";"";"364"
"5";"378";"Eritrea";"";"364"
"5";"379";"Ethiopia";"";"364"
"5";"372";"Gabon";"";"364"
"5";"410";"Gambia";"";"364"
"5";"411";"Ghana";"";"364"
"5";"412";"Guinea";"";"364"
"5";"413";"Guinea-Bissau";"";"364"
"5";"380";"Kenya";"";"364"
"5";"402";"Lesotho";"";"364"
"5";"414";"Liberia";"";"364"
"5";"396";"Libyan Arab Jamahiriya";"";"364"
"5";"381";"Madagascar";"";"364"
"5";"382";"Malawi";"";"364"
"5";"415";"Mali";"";"364"
"5";"416";"Mauritania";"";"364"
"5";"383";"Mauritius";"";"364"
"5";"384";"Mayotte";"";"364"
"5";"397";"Morocco";"";"364"
"5";"385";"Mozambique";"";"364"
"5";"403";"Namibia";"";"364"
"5";"417";"Niger";"";"364"
"5";"418";"Nigeria";"";"364"
"5";"386";"Réunion";"";"364"
"5";"387";"Rwanda";"";"364"
"5";"419";"Saint Helena";"";"364"
"5";"373";"Sao Tome and Principe";"";"364"
"5";"420";"Senegal";"";"364"
"5";"388";"Seychelles";"";"364"
"5";"421";"Sierra Leone";"";"364"
"5";"389";"Somalia";"";"364"
"5";"404";"South Africa";"";"364"
"5";"398";"Sudan";"";"364"
"5";"405";"Swaziland";"";"364"
"5";"390";"Tanzania";"";"364"
"5";"422";"Togo";"";"364"
"5";"399";"Tunisia";"";"364"
"5";"391";"Uganda";"";"364"
"5";"400";"Western Sahara";"";"364"
"5";"392";"Zambia";"";"364"
"5";"393";"Zimbabwe";"";"364"
"5";"423";"Antarctica";"";"0"
"5";"424";"Antarctica";"";"423"
"5";"425";"Bouvet Island";"";"423"
"5";"426";"French Southern territories";"";"423"
"5";"427";"Heard Island and McDonald Islands";"";"423"
"5";"428";"South Georgia and the South Sandwich Islands";"";"423"
"5";"429";"Asia";"";"0"
"5";"467";"Afghanistan";"";"429"
"5";"438";"Armenia";"";"429"
"5";"439";"Azerbaijan";"";"429"
"5";"440";"Bahrain";"";"429"
"5";"468";"Bangladesh";"";"429"
"5";"469";"Bhutan";"";"429"
"5";"456";"Brunei";"";"429"
"5";"457";"Cambodia";"";"429"
"5";"430";"China";"";"429"
"5";"441";"Cyprus";"";"429"
"5";"458";"East Timor";"";"429"
"5";"442";"Georgia";"";"429"
"5";"431";"Hong Kong";"";"429"
"5";"470";"India";"";"429"
"5";"459";"Indonesia";"";"429"
"5";"471";"Iran";"";"429"
"5";"443";"Iraq";"";"429"
"5";"444";"Israel";"";"429"
"5";"432";"Japan";"";"429"
"5";"445";"Jordan";"";"429"
"5";"472";"Kazakstan";"";"429"
"5";"446";"Kuwait";"";"429"
"5";"473";"Kyrgyzstan";"";"429"
"5";"460";"Laos";"";"429"
"5";"447";"Lebanon";"";"429"
"5";"433";"Macao";"";"429"
"5";"461";"Malaysia";"";"429"
"5";"474";"Maldives";"";"429"
"5";"434";"Mongolia";"";"429"
"5";"462";"Myanmar";"";"429"
"5";"475";"Nepal";"";"429"
"5";"435";"North Korea";"";"429"
"5";"448";"Oman";"";"429"
"5";"476";"Pakistan";"";"429"
"5";"449";"Palestine";"";"429"
"5";"463";"Philippines";"";"429"
"5";"450";"Qatar";"";"429"
"5";"451";"Saudi Arabia";"";"429"
"5";"464";"Singapore";"";"429"
"5";"436";"South Korea";"";"429"
"5";"477";"Sri Lanka";"";"429"
"5";"452";"Syria";"";"429"
"5";"437";"Taiwan";"";"429"
"5";"478";"Tajikistan";"";"429"
"5";"465";"Thailand";"";"429"
"5";"453";"Turkey";"";"429"
"5";"479";"Turkmenistan";"";"429"
"5";"454";"United Arab Emirates";"";"429"
"5";"480";"Uzbekistan";"";"429"
"5";"466";"Vietnam";"";"429"
"5";"455";"Yemen";"";"429"
"5";"481";"Europe";"";"0"
"5";"504";"Albania";"";"481"
"5";"505";"Andorra";"";"481"
"5";"519";"Austria";"";"481"
"5";"487";"Belarus";"";"481"
"5";"520";"Belgium";"";"481"
"5";"506";"Bosnia and Herzegovina";"";"481"
"5";"488";"Bulgaria";"";"481"
"5";"507";"Croatia";"";"481"
"5";"489";"Czech Republic";"";"481"
"5";"497";"Denmark";"";"481"
"5";"482";"Estonia";"";"481"
"5";"498";"Faroe Islands";"";"481"
"5";"499";"Finland";"";"481"
"5";"521";"France";"";"481"
"5";"522";"Germany";"";"481"
"5";"508";"Gibraltar";"";"481"
"5";"509";"Greece";"";"481"
"5";"510";"Holy See (Vatican City State)";"";"481"
"5";"490";"Hungary";"";"481"
"5";"500";"Iceland";"";"481"
"5";"485";"Ireland";"";"481"
"5";"511";"Italy";"";"481"
"5";"483";"Latvia";"";"481"
"5";"523";"Liechtenstein";"";"481"
"5";"484";"Lithuania";"";"481"
"5";"524";"Luxembourg";"";"481"
"5";"512";"Macedonia";"";"481"
"5";"513";"Malta";"";"481"
"5";"491";"Moldova";"";"481"
"5";"525";"Monaco";"";"481"
"5";"526";"Netherlands";"";"481"
"5";"501";"Norway";"";"481"
"5";"492";"Poland";"";"481"
"5";"514";"Portugal";"";"481"
"5";"493";"Romania";"";"481"
"5";"494";"Russian Federation";"";"481"
"5";"515";"San Marino";"";"481"
"5";"495";"Slovakia";"";"481"
"5";"516";"Slovenia";"";"481"
"5";"517";"Spain";"";"481"
"5";"502";"Svalbard and Jan Mayen";"";"481"
"5";"503";"Sweden";"";"481"
"5";"527";"Switzerland";"";"481"
"5";"496";"Ukraine";"";"481"
"5";"486";"United Kingdom";"";"481"
"5";"518";"Yugoslavia";"";"481"
"5";"528";"North America";"";"0"
"5";"529";"Anguilla";"";"528"
"5";"530";"Antigua and Barbuda";"";"528"
"5";"531";"Aruba";"";"528"
"5";"532";"Bahamas";"";"528"
"5";"533";"Barbados";"";"528"
"5";"553";"Belize";"";"528"
"5";"561";"Bermuda";"";"528"
"5";"562";"Canada";"";"528"
"5";"534";"Cayman Islands";"";"528"
"5";"554";"Costa Rica";"";"528"
"5";"535";"Cuba";"";"528"
"5";"536";"Dominica";"";"528"
"5";"537";"Dominican Republic";"";"528"
"5";"555";"El Salvador";"";"528"
"5";"563";"Greenland";"";"528"
"5";"538";"Grenada";"";"528"
"5";"539";"Guadeloupe";"";"528"
"5";"556";"Guatemala";"";"528"
"5";"540";"Haiti";"";"528"
"5";"557";"Honduras";"";"528"
"5";"541";"Jamaica";"";"528"
"5";"542";"Martinique";"";"528"
"5";"558";"Mexico";"";"528"
"5";"543";"Montserrat";"";"528"
"5";"544";"Netherlands Antilles";"";"528"
"5";"559";"Nicaragua";"";"528"
"5";"560";"Panama";"";"528"
"5";"545";"Puerto Rico";"";"528"
"5";"546";"Saint Kitts and Nevis";"";"528"
"5";"547";"Saint Lucia";"";"528"
"5";"564";"Saint Pierre and Miquelon";"";"528"
"5";"548";"Saint Vincent and the Grenadines";"";"528"
"5";"549";"Trinidad and Tobago";"";"528"
"5";"550";"Turks and Caicos Islands";"";"528"
"5";"565";"United States";"";"528"
"5";"566";"Alabama";"";"565"
"5";"567";"Alaska";"";"565"
"5";"568";"Arizona";"";"565"
"5";"569";"Arkansas";"";"565"
"5";"570";"California";"";"565"
"5";"571";"Colorado";"";"565"
"5";"572";"Connecticut";"";"565"
"5";"573";"Delaware";"";"565"
"5";"574";"Florida";"";"565"
"5";"575";"Georgia";"";"565"
"5";"576";"Hawaii";"";"565"
"5";"577";"Idaho";"";"565"
"5";"578";"Illinois";"";"565"
"5";"579";"Indiana";"";"565"
"5";"580";"Iowa";"";"565"
"5";"581";"Kansas";"";"565"
"5";"582";"Kentucky";"";"565"
"5";"583";"Louisiana";"";"565"
"5";"584";"Maine";"";"565"
"5";"585";"Maryland";"";"565"
"5";"586";"Massachusetts";"";"565"
"5";"587";"Michigan";"";"565"
"5";"588";"Minnesota";"";"565"
"5";"589";"Mississippi";"";"565"
"5";"590";"Missouri";"";"565"
"5";"591";"Montana";"";"565"
"5";"592";"Nebraska";"";"565"
"5";"593";"Nevada";"";"565"
"5";"594";"New Hampshire";"";"565"
"5";"595";"New Jersey";"";"565"
"5";"596";"New Mexico";"";"565"
"5";"597";"New York";"";"565"
"5";"598";"North Carolina";"";"565"
"5";"599";"North Dakota";"";"565"
"5";"600";"Ohio";"";"565"
"5";"601";"Oklahoma";"";"565"
"5";"602";"Oregon";"";"565"
"5";"603";"Pennsylvania";"";"565"
"5";"604";"Rhode Island";"";"565"
"5";"605";"South Carolina";"";"565"
"5";"606";"South Dakota";"";"565"
"5";"607";"Tennessee";"";"565"
"5";"608";"Texas";"";"565"
"5";"609";"Utah";"";"565"
"5";"610";"Vermont";"";"565"
"5";"611";"Virginia";"";"565"
"5";"612";"Washington";"";"565"
"5";"613";"West Virginia";"";"565"
"5";"614";"Wisconsin";"";"565"
"5";"615";"Wyoming";"";"565"
"5";"551";"Virgin Islands, British";"";"528"
"5";"552";"Virgin Islands, U.S.";"";"528"
"5";"616";"Oceania";"";"0"
"5";"635";"American Samoa";"";"616"
"5";"617";"Australia";"";"616"
"5";"618";"Christmas Island";"";"616"
"5";"619";"Cocos (Keeling) Islands";"";"616"
"5";"636";"Cook Islands";"";"616"
"5";"622";"Fiji Islands";"";"616"
"5";"637";"French Polynesia";"";"616"
"5";"627";"Guam";"";"616"
"5";"628";"Kiribati";"";"616"
"5";"629";"Marshall Islands";"";"616"
"5";"630";"Micronesia, Federated States of";"";"616"
"5";"631";"Nauru";"";"616"
"5";"623";"New Caledonia";"";"616"
"5";"620";"New Zealand";"";"616"
"5";"638";"Niue";"";"616"
"5";"621";"Norfolk Island";"";"616"
"5";"632";"Northern Mariana Islands";"";"616"
"5";"633";"Palau";"";"616"
"5";"624";"Papua New Guinea";"";"616"
"5";"639";"Pitcairn";"";"616"
"5";"640";"Samoa";"";"616"
"5";"625";"Solomon Islands";"";"616"
"5";"641";"Tokelau";"";"616"
"5";"642";"Tonga";"";"616"
"5";"643";"Tuvalu";"";"616"
"5";"634";"United States Minor Outlying Islands";"";"616"
"5";"626";"Vanuatu";"";"616"
"5";"644";"Wallis and Futuna";"";"616"
"5";"645";"South America";"";"0"
"5";"646";"Argentina";"";"645"
"5";"647";"Bolivia";"";"645"
"5";"648";"Brazil";"";"645"
"5";"649";"Chile";"";"645"
"5";"650";"Colombia";"";"645"
"5";"651";"Ecuador";"";"645"
"5";"652";"Falkland Islands";"";"645"
"5";"653";"French Guiana";"";"645"
"5";"654";"Guyana";"";"645"
"5";"655";"Paraguay";"";"645"
"5";"656";"Peru";"";"645"
"5";"657";"Suriname";"";"645"
"5";"658";"Uruguay";"";"645"
"5";"659";"Venezuela";"";"645"
关于层次结构中的 MySQL 世界数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13089255/
我目前正在尝试基于哈希表构建字典。逻辑是:有一个名为 HashTable 的结构,其中包含以下内容: HashFunc HashFunc; PrintFunc PrintEntry; CompareF
如果我有一个指向结构/对象的指针,并且该结构/对象包含另外两个指向其他对象的指针,并且我想删除“包含这两个指针的对象而不破坏它所持有的指针”——我该怎么做这样做吗? 指向对象 A 的指针(包含指向对象
像这样的代码 package main import "fmt" type Hello struct { ID int Raw string } type World []*Hell
我有一个采用以下格式的 CSV: Module, Topic, Sub-topic 它需要能够导入到具有以下格式的 MySQL 数据库中: CREATE TABLE `modules` ( `id
通常我使用类似的东西 copy((uint8_t*)&POD, (uint8_t*)(&POD + 1 ), back_inserter(rawData)); copy((uint8_t*)&PODV
错误 : 联合只能在具有兼容列类型的表上执行。 结构(层:字符串,skyward_number:字符串,skyward_points:字符串)<> 结构(skyward_number:字符串,层:字符
我有一个指向结构的指针数组,我正在尝试使用它们进行 while 循环。我对如何准确初始化它并不完全有信心,但我一直这样做: Entry *newEntry = malloc(sizeof(Entry)
我正在学习 C,我的问题可能很愚蠢,但我很困惑。在这样的函数中: int afunction(somevariables) { if (someconditions)
我现在正在做一项编程作业,我并没有真正完全掌握链接,因为我们还没有涉及它。但是我觉得我需要它来做我想做的事情,因为数组还不够 我创建了一个结构,如下 struct node { float coef;
给定以下代码片段: #include #include #define MAX_SIZE 15 typedef struct{ int touchdowns; int intercepti
struct contact list[3]; int checknullarray() { for(int x=0;x<10;x++) { if(strlen(con
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Empty “for” loop in Facebook ajax what does AJAX call
我刚刚在反射器中浏览了一个文件,并在结构构造函数中看到了这个: this = new Binder.SyntaxNodeOrToken(); 我以前从未见过该术语。有人能解释一下这个赋值在 C# 中的
我经常使用字符串常量,例如: DICT_KEY1 = 'DICT_KEY1' DICT_KEY2 = 'DICT_KEY2' ... 很多时候我不介意实际的文字是什么,只要它们是独一无二的并且对人类读
我是 C 的新手,我不明白为什么下面的代码不起作用: typedef struct{ uint8_t a; uint8_t* b; } test_struct; test_struct
您能否制作一个行为类似于内置类之一的结构,您可以在其中直接分配值而无需调用属性? 前任: RoundedDouble count; count = 5; 而不是使用 RoundedDouble cou
这是我的代码: #include typedef struct { const char *description; float value; int age; } swag
在创建嵌套列表时,我认为 R 具有对列表元素有用的命名结构。我有一个列表列表,并希望应用包含在任何列表中的每个向量的函数。 lapply这样做但随后剥离了列表的命名结构。我该怎么办 lapply嵌套列
我正在做一个用于学习目的的个人组织者,我从来没有使用过 XML,所以我不确定我的解决方案是否是最好的。这是我附带的 XML 文件的基本结构:
我是新来的 nosql概念,所以当我开始学习时 PouchDB ,我找到了这个转换表。我的困惑是,如何PouchDB如果可以说我有多个表,是否意味着我需要创建多个数据库?因为根据我在 pouchdb
我是一名优秀的程序员,十分优秀!