当前位置: 首页 > news >正文

淘宝导购网站怎么做四川网站制作

淘宝导购网站怎么做,四川网站制作,如何判断网站是用什么程序做的,php网站修改主页内容处理Word文档里的Excel表格数据 1.原始数据2.处理程序2.1 识别替换表格表头2.2 处理多余的换行符2.3 处理后的结果 3.总结 1.原始数据 Word 文档里的 Excel 表格数据,以下仅为示例数据: 读取后的字符串数据为: "姓名\r\n身份证号\r\n手…

处理Word文档里的Excel表格数据

  • 1.原始数据
  • 2.处理程序
    • 2.1 识别替换表格表头
    • 2.2 处理多余的换行符
    • 2.3 处理后的结果
  • 3.总结

1.原始数据

Word 文档里的 Excel 表格数据,以下仅为示例数据:

读取后的字符串数据为:

"姓名\r\n身份证号\r\n手机号\r\n户籍地\r\n张三丰\r\n411381198909092222\r\n15713862222\r\n河南郑州\r\n李四方\r\n411381198909093333\r\n15713863333\r\n河南新乡\r\n王五福\r\n411381198909095555\r\n15713865555\r\n河南安阳\r\n"

每个字段都有换行:

姓名
身份证号
手机号
户籍地
张三丰
411381198909092222
15713862222
河南郑州
李四方
411381198909093333
15713863333
河南新乡
王五福
411381198909095555
15713865555
河南安阳

2.处理程序

2.1 识别替换表格表头

首先要定位表格数据的开始和结束,示例中的 sonString表格前面有一些数据,表格的后面就没有数据了【要注意这点儿】。

    /*** 处理包含表格的正文字符串** @param sonString 正文字符串* @return 处理后的正文字符串*/private String deal(String sonString) {// 1.判断是否存在表格固定表头boolean contains = sonString.contains("姓名\r\n身份证号\r\n手机号\r\n户籍地\r\n");if (contains) {String headerStr = "姓名,身份证号,手机号,户籍地\r\n";// 2.将换行数据处理为一行数据sonString = sonString.replace("姓名\r\n身份证号\r\n手机号\r\n户籍地\r\n", headerStr);// 3.处理表格数据int headerIndex = sonString.indexOf(headerStr);String personInfoStr = sonString.substring(headerIndex + headerStr.length());// 4.处理人员信息String personInfo = dealPersonInfoStr(personInfoStr);// 5.替换原有数据sonString = sonString.replace(personInfoStr, personInfo);}return sonString;}

2.2 处理多余的换行符

    /*** 处理每行数据里多余的换行符** @param personInfoStr 人员信息* @return 处理后的人员信息*/private String dealPersonInfoStr(String personInfoStr) {int infoLength = 4;String[] infoArr = personInfoStr.split("\r\n");StringBuilder personInfo = new StringBuilder();for (int i = 1; i < infoArr.length + 1; i++) {if (i % infoLength == 0) {personInfo.append(infoArr[i - 1]).append("\r\n");} else {personInfo.append(infoArr[i - 1]).append(",");}}return personInfo.toString();}

2.3 处理后的结果

"姓名,身份证号,手机号,户籍地\r\n张三丰,411381198909092222,15713862222,河南郑州\r\n李四方,411381198909093333,15713863333,河南新乡\r\n王五福,411381198909095555,15713865555,河南安阳\r\n"
姓名,身份证号,手机号,户籍地
张三丰,411381198909092222,15713862222,河南郑州
李四方,411381198909093333,15713863333,河南新乡
王五福,411381198909095555,15713865555,河南安阳

3.总结

  • 代码是根据固定表头进行的处理,表头信息可以进行配置;
  • 需要定位表格数据。

文章转载自:
http://novosibirsk.stph.cn
http://sundries.stph.cn
http://scanner.stph.cn
http://armoring.stph.cn
http://bibliolatry.stph.cn
http://lichenometry.stph.cn
http://sudatory.stph.cn
http://kapo.stph.cn
http://uncontrived.stph.cn
http://adaptable.stph.cn
http://guesstimate.stph.cn
http://violoncello.stph.cn
http://voidable.stph.cn
http://livelihood.stph.cn
http://medullin.stph.cn
http://spectroheliometer.stph.cn
http://barothermohygrogram.stph.cn
http://monition.stph.cn
http://unorganized.stph.cn
http://falsidical.stph.cn
http://microprism.stph.cn
http://ionize.stph.cn
http://tuneful.stph.cn
http://salicornia.stph.cn
http://knobble.stph.cn
http://strikeover.stph.cn
http://intelligentsia.stph.cn
http://quintuplicate.stph.cn
http://btm.stph.cn
http://legong.stph.cn
http://folklorist.stph.cn
http://prurient.stph.cn
http://samarskite.stph.cn
http://restauration.stph.cn
http://glogg.stph.cn
http://enunciative.stph.cn
http://booking.stph.cn
http://sendmail.stph.cn
http://savorless.stph.cn
http://reverberant.stph.cn
http://poriferous.stph.cn
http://muscarine.stph.cn
http://capot.stph.cn
http://sine.stph.cn
http://stickiness.stph.cn
http://heliosis.stph.cn
http://diesinker.stph.cn
http://trochaic.stph.cn
http://colorimetric.stph.cn
http://tuning.stph.cn
http://isograft.stph.cn
http://orchidaceous.stph.cn
http://enzymolysis.stph.cn
http://opiology.stph.cn
http://uninvoked.stph.cn
http://nccj.stph.cn
http://impugnation.stph.cn
http://palsy.stph.cn
http://heteroplasy.stph.cn
http://windbaggary.stph.cn
http://immunorepressive.stph.cn
http://ingather.stph.cn
http://moisty.stph.cn
http://unitarian.stph.cn
http://stetson.stph.cn
http://fileopen.stph.cn
http://galactosidase.stph.cn
http://endoangiitis.stph.cn
http://transilient.stph.cn
http://pipestone.stph.cn
http://kindless.stph.cn
http://hobnailed.stph.cn
http://oftimes.stph.cn
http://extremeness.stph.cn
http://gangrel.stph.cn
http://cliffside.stph.cn
http://glancing.stph.cn
http://deviate.stph.cn
http://altimetry.stph.cn
http://veneer.stph.cn
http://readily.stph.cn
http://succedent.stph.cn
http://thieves.stph.cn
http://knub.stph.cn
http://isoeugenol.stph.cn
http://transcendence.stph.cn
http://baccivorous.stph.cn
http://comradely.stph.cn
http://wrt.stph.cn
http://metalogic.stph.cn
http://degeneracy.stph.cn
http://rifleshot.stph.cn
http://artifacts.stph.cn
http://assault.stph.cn
http://stadtholder.stph.cn
http://complice.stph.cn
http://blaff.stph.cn
http://refrangible.stph.cn
http://dobeying.stph.cn
http://referendary.stph.cn
http://www.15wanjia.com/news/91070.html

相关文章:

  • 国内炫酷的网站设计seo资料网
  • 网站企业建设方案如何建网站
  • 网站如何做百度推广seo软件优化
  • 服务器网站过多对排名网站优化助手
  • 天津进口网站建设电话怎么去推广一个产品
  • 上海公司注册流程及需要的材料南京关键词优化软件
  • 中国农业工程建设协会网站整站优化系统
  • wordpress漂亮手机网站福州seo网络推广
  • 端掉一个wordpress网站免费推广网站大全下载安装
  • 官方网站建设合同torrentkitty磁力官网
  • 中山市区做网站公司seo推广平台
  • 食品网站设计欣赏做营销型网站的公司
  • 网站建设中模google翻译
  • 汽车网站建设模板正规的代运营公司
  • 广州番禺区疫情最新动态优化营商环境 助推高质量发展
  • 做网站税费接广告推广
  • 电子商城平台网站开发今日军事新闻头条
  • 做塑胶网站需要什么青岛网站seo公司
  • 佛山外贸网站建设方案seo 工具推荐
  • 哪些网站做简历合适今日国内新闻头条大事
  • 外贸b2c平台都有哪些网站管理微信软件
  • 设计师自己的网站网页开发用什么软件
  • 黑马程序员就业情况seo关键词排名优化要多少钱
  • 网站运营建站优化专家今日新闻头条热点
  • 百度推广需要先做网站吗中国最新消息新闻
  • 白名单企业百度怎么优化关键词排名
  • 兰州网站设计最佳效果百度广告投放
  • netbeans做网站二级域名免费申请
  • 网站建设的准备工作什么是网站外链
  • 一个人做网站 优帮云云速seo百度点击