文档章节

如何将excel中的对应关系放到map中

writeademo
 writeademo
发布于 2017/03/20 11:00
字数 1325
阅读 15
收藏 0

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

这么多的城市往map中放,一个一个放肯定费时费力

 

这时就要用到sublime,两个快捷键

1.滚轮+左键,功能:选中一列,保持竖向对齐

2ctrl+shift+L选中列 用法:首先选中全部内容按快捷键,再按方向键—>就到了每一个行的尾部,竖向上并不是对齐的

 

将内容复制过来时要注意行数是否相同:

1行数相同,那么就会得到对应填入的结果

2,行数不同,那么每一行都会填满内容,得不到相应结果

 

 

最后结果如下:

city.put("xiaogan","孝感市");

city.put("liangshan","凉山州");

city.put("honghe","红河州");

city.put("hechi","河池市");

city.put("yiyang","益阳市");

city.put("enshi","恩施州");

city.put("hanzhong","汉中市");

city.put("baise","百色市");

city.put("qinzhou","钦州市");

city.put("tianshui","天水市");

city.put("wenshan","文山州");

city.put("heyuan","河源市");

city.put("bazhong","巴中市");

city.put("zigong","自贡市");

city.put("guangan","广安市");

city.put("jingmen","荆门市");

city.put("ls","丽水市");

city.put("shunde","顺德");

city.put("haimen","海门市");

city.put("haining","海宁市");

city.put("putian","莆田市");

city.put("jiangdu","江都");

city.put("kaiping","开平");

city.put("linan","临安市");

city.put("gdlm","龙门");

city.put("jieyang","揭阳市");

city.put("jingzhou","荆州市");

city.put("dazhou","达州市");

city.put("yichun","宜春市");

city.put("ahsuzhou","宿州市");

city.put("huaihua","怀化市");

city.put("zhaotong","昭通市");

city.put("ziyang","资阳市");

city.put("shiyan","十堰市");

city.put("dali","大理市");

city.put("shanwei","汕尾市");

city.put("pingxiang","萍乡市");

city.put("shaoguan","韶关市");

city.put("jr","句容市");

city.put("huidong","惠东");

city.put("yibin","宜宾市");

city.put("yongchuan","永川区");

city.put("chenzhou","郴州市");

city.put("deqing","德清县");

city.put("ezhou","鄂州市");

city.put("fuling"","涪陵市");

city.put("fq","福清市");

city.put("fuyang","阜阳市");

city.put("puning","普宁");

city.put("tongxiang","桐乡市");

city.put("wanzhou","万州区");

city.put("xianning","咸宁市");

city.put("xiangxi","湘西州");

city.put("zhenhai","镇海");

city.put("zj","湛江市");

city.put("guigang","贵港市");

city.put("meishan","眉山市");

city.put("huainan","淮南市");

city.put("changde","常德市");

city.put("maoming","茂名市");

city.put("NB","宁波市");

city.put("HF","合肥市");

city.put("BJ","北京市");

city.put("FS","佛山市");

city.put("FZ","福州市");

city.put("XM","厦门市");

city.put("WUXI","无锡市");

city.put("LZ","兰州市");

city.put("SZ","深圳市");

city.put("changle","长乐市");

city.put("zjg","张家港市");

city.put("dujiangyan","都江堰");

city.put("HUIZHOU","惠州市");

city.put("WJ","吴江市");

city.put("ZH","珠海市");

city.put("CZ","常州市");

city.put("GZ","广州市");

city.put("NN","南宁市");

city.put("changshu","常熟市");

city.put("zhaoqing","肇庆市");

city.put("KS","昆山市");

city.put("ZHENJIANG","镇江市");

city.put("GY","贵阳市");

city.put("JM","江门市");

city.put("SHAOXING","绍兴市");

city.put("YC","宜昌市");

city.put("hn","海南州");

city.put("SANYA","三亚市");

city.put("SJZ","石家庄市");

city.put("ZZ","郑州市");

city.put("SUZHOU","苏州市");

city.put("HRB","哈尔滨市");

city.put("neijiang","内江市");

city.put("WUHAN","武汉市");

city.put("CS","长沙市");

city.put("cc","长春市");

city.put("dg","东莞市");

city.put("LIUZHOU","柳州市");

city.put("YZ","扬州市");

city.put("NT","南通市");

city.put("XZ","徐州市");

city.put("NJ","南京市");

city.put("bh","北海市");

city.put("taizhou","泰州市");

city.put("qingyuan","清远市");

city.put("NC","南昌市");

city.put("ZS","中山市");

city.put("SY","沈阳市");

city.put("guilin","桂林市");

city.put("jx","嘉兴市");

city.put("QZ","泉州市");

city.put("mianyang","绵阳市");

city.put("xianyang","咸阳市");

city.put("jy","江阴市");

city.put("wuhu","芜湖市");

city.put("huzhou","湖州市");

city.put("mas","马鞍山市");

city.put("jiujiang","九江市");

city.put("ganzhou","赣州市");

city.put("suining","遂宁市");

city.put("deyang","德阳市");

city.put("nanchong","南充市");

city.put("leshan","乐山市");

city.put("ST","汕头市");

city.put("bengbu","蚌埠市");

city.put("hengyang","衡阳市");

city.put("huaian","淮安市");

city.put("lyg","连云港市");

city.put("NM","呼和浩特市");

city.put("YINCHUAN","银川市");

city.put("xt","湘潭市");

city.put("xiangyang","襄阳市");

city.put("yancheng","盐城市");

city.put("yueyang","岳阳市");

city.put("zhangzhou","漳州市");

city.put("zhoushan","舟山市");

city.put("zhuzhou","株洲市");

city.put("meizhou","梅州市");

city.put("luzhou","泸州市");

city.put("wz","温州市");

city.put("jh","金华市");

city.put("fangchenggang","防城港市");

city.put("xn","西宁市");

city.put("bazhou"","巴音郭楞州");

city.put("lijiang","丽江市");

city.put("yangjiang","阳江市");

city.put("luan","六安市");

city.put("yl","玉林市");

city.put("yongzhou","永州市");

city.put("anqing","安庆市");

city.put("bozhou","亳州市");

city.put("zunyi","遵义市");

city.put("shaoyang","邵阳市");

city.put("xingtai","邢台市");

city.put("laiwu","莱芜市");

city.put("hbbz","霸州");

city.put("xx","新乡市");

city.put("zhumadian","驻马店市");

city.put("QD","青岛市");

city.put("cangzhou","沧州市");

city.put("shangqiu","商丘市");

city.put("anyang","安阳市");

city.put("bt","包头市");

city.put("jining","济宁市");

city.put("lc","聊城市");

city.put("taian","泰安市");

city.put("binzhou","滨州市");

city.put("zb","淄博市");

city.put("anshan","鞍山市");

city.put("daqing","大庆市");

city.put("linyi","临沂市");

city.put("WEIHAI"","威海市");

city.put("ly","洛阳市");

city.put("lf","廊坊市");

city.put("hd","邯郸市");

city.put("TS","唐山市");

city.put("JN","济南市");

city.put("WF","潍坊市");

city.put("YT","烟台市");

city.put("ty","太原市");

city.put("XIAN","西安市");

city.put("SH","上海市");

city.put("CD","成都市");

city.put("TJ","天津市");

city.put("DL","大连市");

city.put("QHD","秦皇岛市");

city.put("xj","乌鲁木齐市");

city.put("jl","吉林市");

city.put("hs","衡水市");

city.put("KM","昆明市");

city.put("hz","杭州市");

city.put("CQ","重庆市");

city.put("yutian","玉田");

city.put("gaobeidian","高碑店");

city.put("bd","保定市");

city.put("baoji","宝鸡市");

city.put("akesu","阿克苏地区");

city.put("shihezi","石河子市");

city.put("changji","昌吉州");

city.put("huangshi","黄石市");

city.put("dongying","东营市");

city.put("dezhou","德州市");

city.put("datong","大同市");

city.put("fushun","抚顺市");

city.put("xuchang","许昌市");

city.put("rizhao","日照市");

city.put("puyang","濮阳市");

city.put("kaifeng","开封市");

city.put("jiamusi","佳木斯市");

city.put("heze","菏泽市");

city.put("zhongmou","中牟");

city.put("tengzhou","滕州市");

city.put("zhangjiakou","张家口市");

city.put("shuozhou","朔州市");

city.put("xinzheng","新郑");

city.put("jiaonan","胶南");

city.put("hbsh","三河");

city.put("tjjx","蓟州");

city.put("siping","四平市");

city.put("changzhi","长治市");

city.put("jinzhong","晋中市");

city.put("jiaozuo","焦作市");

city.put("pingdingshan","平顶山市");

city.put("yuncheng","运城市");

city.put("qiqihaer","齐齐哈尔市");

city.put("suihua","绥化市");

city.put("zhoukou","周口市");

city.put("xinyang","信阳市");

city.put("nanyang","南阳市");

 

 

© 著作权归作者所有

writeademo
粉丝 25
博文 704
码字总数 268781
作品 0
东城
私信 提问
springmvc框架原理分析

springmvc全名是spring web mvc,springmvc是spring的一个模块,并且看名字即可知道,springmvc是一个基于mvc设计模式的前端web框架。mvc:m(model模型)、v(view视图)、c(control控制) Sprin...

明理萝
2018/08/27
60
1
如何从Excel中向SQL SERVER 2008导入数据

1)在数据库中新建数据库表 2)准备好Excel数据,第一列为数据库表的字段名称 3)打开 Microsoft SQL Server Management Studio,选择自己要添加数据的数据库,右击-任务-导入数据。 4)点击下...

skydev
03/29
0
0
Scrapy:在pipeline的process_item中的一个并发/线程安全方面的问题

如,一个将数据保存到excel文件的管道类,作为一个通用类,不写死Item类的判断过程,用dict来map类名和文件的关系, outputs = {‘AAAAAItem’: dict(wb=wb, ws=ws), 'BBBBBItem': dict(wb=...

JorringHsiao
02/10
352
1
扩展bboss ioc语法实现自定义的ioc依赖注入功能

bboss ioc配置语法简洁而严谨,提供了强大的依赖注入功能,而且开发人员可以任意为ioc元素property增加扩展属性,从而实现自定义的ioc依赖注入功能。业界其他ioc框架自定义扩展ioc语法,可能...

bboss
2015/01/20
0
0
Java容器类框架分析(4)LinkedHashMap源码分析

概述 在分析LinkedHashMap的源码之前先看一下LinkedHashMap的继承关系 LinkedHashMap继承关系 通过上述继承关系可以看到,LinkedHashMap继承自HashMap,也就是具有HashMap的所有功能,然后再...

wustor
2017/11/06
0
0

没有更多内容

加载失败,请刷新页面

加载更多

聊聊rocketmq producer的batch

序 本文主要研究一下rocketmq producer的batch batch rocketmq-client-4.6.0-sources.jar!/org/apache/rocketmq/client/producer/DefaultMQProducer.java public class DefaultMQProducer ex......

go4it
昨天
4
0
Delphi中的延时

开发过程中经常会需要使用到延时功能,Delphi中有不少实现延时的方法,网上已有不少文章做过说明和分析,但本着实践出真知的态度,还是亲自动手研究一番心里比较踏实。 常用的延时方法 Slee...

天朝八阿哥
昨天
4
0
001-Consul

Consul安装(单节点) mkdir -p /data/consulcd /data/consulwget https://releases.hashicorp.com/consul/1.6.2/consul_1.6.2_linux_amd64.zipunzip consul_1.6.2_linux_amd64.zip复制c......

伟大源于勇敢的开始
昨天
4
0
nginx + frp 搭建内网穿透

上一个项目是开发微信公众号,由于微信的各种烦人操作,只能到处找内网映射工具 ngrok也用过,花生壳也用过 都不怎么稳定,无意间听说了frp,本着一颗折腾的心搭建了一下,结果发现很不错,就...

lineasy
昨天
7
0
构建CRD工程 - 程序员学点xx 43 k8s

Kubernetes -3- <!--more--> <center>这是yann的第98篇分享</center> [TOC] 本日状态: 帮同事排了一天bug。 Kubernetes -3- <!--more--> 这是yann的第98篇分享 第 1 部分 承前 昨天用视屏的方......

tmp4
昨天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部