回复 18# yamakawa
单独执行时好像没问题,但和其它代码一起执行就出错,分别存储文件后发现输出格式上有差异:
因为原来考虑还要读取代码,而0开头的代码按数字格式的话读取时前面的0会被消去,为保险起见,改成了字符类型(但本列中不包含代码)。所以我的输出格式是这样的:
"time","name","type","value"
"↓09:44","永辉超市","加速下跌","-2.1%"
"◆09:44","惠发股份","大笔卖出","326"
"◆09:44","科锐国际","大笔卖出","541"
"↑09:44","青龙管业","火箭发射","1.0%"
"↓09:44","金牌厨柜","高台跳水","5.3%"
"◆09:44","我乐家居","大笔买入","608"
"◆09:44","世名科技","大笔买入","183"
"↓09:44","长久物流","加速下跌","-1.7%"
"↓09:44","格力电器","打压指数","0.51点"
"◆09:44","必创科技","大笔卖出","186"
"◆09:44","华体科技","大笔卖出","562"
"↑09:44","云南锗业","火箭发射","4.6%"
"↑09:44","创新股份","火箭发射","3.8%"
你的代码处理后是这样的:
time,name,type,value
◆09:44,杭州园林,大笔买入,198
↓09:44,恒通科技,高台跳水,2.1%
↑09:44, 安奈儿,火箭发射,2.8%
↑09:44,中矿资源,火箭发射,2.7%
◆09:44,必创科技,大笔卖出,247
↑09:44,上海洗霸,火箭发射,1.8%
◆09:44,弘信电子,大笔卖出,343
◆09:44,科锐国际,大笔买入,721
◆09:44,华体科技,大笔卖出,267
◆09:44,天马科技,大笔卖出,765
◆09:44,必创科技,大笔卖出,1046
◆09:44,杰恩设计,大笔买入,267
↓09:44,永辉超市,加速下跌,-2.1%
◆09:44,惠发股份,大笔卖出,326
对正则不熟,你的代码我还看不大懂,麻烦再改下我再试试。谢谢。 |