标签:
最近客户提出的的BUG比较多,但是一一筛选出url又比较麻烦,所以从客户的BUGLIST的description中去取url,写了个简单的获取url输出到excel的方法:-D
以下是源码:
# -*- coding: utf-8 -*- import re,xlwt,xlrd from xlutils.copy import copy def reinfourl(test): m = re.search(r"[a-zA-z]+://[^\s]*",test) if m : return m.group(0) else: return "no url" oldex = xlrd.open_workbook(r"buglist218.xls") oldsh = oldex.sheet_by_index(0) nrows = oldsh.nrows newex = copy(oldex) newsh = newex.get_sheet(0) for i in range(1,nrows): test = oldsh.cell(i,3).value newsh.write(i,4,reinfourl(test)) print "#%d"%i,reinfourl(test) newex.save(r"buglist218.xls")
取回来excel style:
标签:
原文地址:http://www.cnblogs.com/BUGU/p/5197393.html