Giter Site home page Giter Site logo

liuzhoudata's Introduction

LiuZhoucode

python版本2.7

公司安排的任务,觉得用Java写比较麻烦,就用py了。感觉就是他们的数据太乱了,要求还多 具体提取要求在数据提取要求.doc,简单讲就是把下面字段提取出来

采购项目名称、采购项目编号、采购人、采购人地址、采购联系人、采购联系人电话、中标供应商名称、中标供应商地址、中标金额(数值型)、公告日期

然后金额需要数值类型的,保留两位小数,(原文件里面是有数字有中文的)金额转换的写在transfer2num.py这个实用价值比较大吧(我觉得)

日期要求全部类似20170203这样的。日期转换写在transfer2date.py

最后要求把2017年1月到3月的数据单独提取

其实想法很简单就是从excel里读取一行行记录,通过正则表达式去匹配这些字符,然后把匹配到的写入excel

使用了python的 xlrd xlwt库 需要的 直接pip install xlrd ,pip install xlwt

如果装不上去就去百度下。 可以通过这个学下xlrd xlwt的使用以及正则表达式,正则表达式我写的比较多里面,需要点耐心看的。

留下个star 蟹蟹!

哦,跑的时候记得改一下文件读取的路径和文件名!

liuzhoudata's People

Contributors

lifefloating avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.