标题: [文本处理] 【已解决】批处理如何对比数据条目 找出更新的条目 [打印本页]
作者: uuu888s 时间: 2015-4-20 11:33 标题: 【已解决】批处理如何对比数据条目 找出更新的条目
本帖最后由 uuu888s 于 2015-4-21 09:06 编辑
现有一几天前的数据条目文件 a.txt 假设内容如下
var RoaqyFPm={pages:1,data:["002042,华孚色纺,88,18837971,0.0226148126773274,增仓,15170345,4.136284615716,2015-03-31","600517,置信电气,1,7467160,0.00600002110046579,减仓,-6182622,-0.452946574531373,2015-03-31","002013,中航机电,1,3449707,0.00481610067451324,减仓,-6506264,-0.653503711491325,2015-03-31","600086,东方金钰,3,21662045,0.0481378777777778,减仓,-10277407,-0.321777812593654,2015-03-31","002276,万马股份,2,22154366,0.0235776173664484,减仓,-17645634,-0.443357638190955,2015-03-31"]}
从
http://datainterface.eastmoney.com//JS.aspx?type=8&js=var%20RoaqyFPm={pagespc),data:[(x)]}&stat=6&cmd=1&fd=2015-03-31
获取最新的数据条目文件 存为b.txt
对比b.txt 和a.txt 找出更新的条目
存为c.txt
大牛帮帮忙 在线等 不胜感激!!
作者: apang 时间: 2015-4-20 23:57
本帖最后由 apang 于 2015-4-21 21:11 编辑
- @set @n=0;//&cscript -nologo -e:jscript "%~0"<a.txt>c.txt & pause & exit/b
-
- url = 'http://datainterface.eastmoney.com/EM_DataCenter/JS.aspx?type=ZLSJ&sty=ZLCC&st=5&sr=-1&p=1&ps=888&js=var%20RoaqyFPm={pages:(pc),data:[(x)]}&stat=6&cmd=1&fd=2015-03-31';
- s = WScript.StdIn.ReadAll();
-
- with(new ActiveXObject('Microsoft.XMLHTTP')) {
- Open('GET', url, false);
- Send();
- eval(responseText);
- }
-
- arr = RoaqyFPm.data;
- arrTmp = [];
- for(var i=0; i<arr.length; i++) {
- s1 = '"' + arr[i] + '"';
- if(s.indexOf(s1) < 0) arrTmp.push(s1);
- }
-
- WScript.StdOut.Write('var RoaqyFPm={pages:1,data:[' + arrTmp + ']}')
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |