批处理脚本在文本文件中搜索字符串;(Batch script to search strings in text file; echo string found or not found)
我需要一个CMD脚本,它能够基于findtr命令来搜索文本文件,该命令有多个字符串可供搜索。
在这种情况下,我创建了一个包含命令结果的文本文件(kb.txt) :
wmic qfe list
我需要的脚本将读取文件并使用findstr命令搜索它,如下所示:
findstr "kb3199321 kb3175631 kb3155567 kb3143345"
如果未找到该字符串,则会输出未找到的字符串。 对于那些已经找到的人也是如此。 输出示例:
kb3199321 not found kb3175631 found kb3155567 found kb3143345 not found
脚本应该遍历所有字符串的findstr命令(不仅仅是上面列出的4个,它可能是几十到几百个),并且对于它们中的每个字符串,如果找到该字符串,则回显。
注意
如果findstr命令太有限(无法搜索超过一百个字符串),那么脚本应从另一个单独的文本文件(例如“searchfile.txt”)中读取所有字符串,然后搜索“ kb.txt“来查看它是否能够找到字符串,并回显与上面相同的想要的结果
I need a CMD script that is able to search through a text file based on a findstr command that has multiple strings in it to be searched for.
In this case, I have created a text file (kb.txt) that contains the result of the command:
wmic qfe list
The script I need will read the file and searches through it with the findstr command like:
findstr "kb3199321 kb3175631 kb3155567 kb3143345"
If the string is not found, it will output the string that is not found. The same goes for those that have been found. Example of output:
kb3199321 not found kb3175631 found kb3155567 found kb3143345 not found
The script should loop through the findstr command for all its strings (not just the 4 listed above, it could be a few dozen to hundreds), and for each of them, echo if the string is found or not.
Note
If the findstr command is too limited (where it can't search through more than a hundred strings), then the script should read off all the strings from another separate text file (e.g. "searchfile.txt"), then search through the "kb.txt" to see if it is able to find the strings, and echo the same wanted results as above
原文:https://stackoverflow.com/questions/40857062
最满意答案
你可以试试iOS的facebook sdk。
对于页面中的展示帖子,您可以通过Facebook对象请求$ {pageId} / feed。 这样的事情。 这是页面对象 。
[facebook requestWithGraphPath:@"pageId/feed" andDelegate:self];
推送通知,您必须通过选中相同的$ {pageId} / Feed来检查服务器中是否每2分钟有一个新的Feed。 如果$ {pageId} / Feed中有新帖子,您可以将内容推送给粉丝。
从iphone中的$ {pageId} / feed获取数据(这是一个post对象)后,您可以将它们存储到核心数据中。 post对象中有一个“喜欢”的字段供您订购。
You can try the facebook sdk for iOS.
for show posts in the page, you can request a ${pageId}/feed via Facebook object. something like this. Here is the page object.
[facebook requestWithGraphPath:@"pageId/feed" andDelegate:self];
push notification, you have to check if there is a new feed in the page for maybe every 2 mins in your server by checking the same ${pageId}/feed. And if there is a new post in the ${pageId}/feed, you can push the content to your fans.
After you get the data(which is a post object) from ${pageId}/feed in the iphone, you can store them into core data. There is a field "likes" in the post object for you to order by.
相关问答
更多-
FB SDk获取用户页面信息(FB SDk Get users page info)[2022-09-14]
只需2个步骤: 获得用户的“manage_pages”权限 通过拨打FB.api(/me/accounts)获取所有帐户信息 方式二,从Fql查询得到它: SELECT page_id, type from page_admin WHERE uid=me() page_admin文档在这里 Just 2 steps: get "manage_pages" permission from user Get all account information by calling FB.api(/me/accou ... -
获取fb.me网址(Getting fb.me URL)[2022-12-30]
Facebook使用Bit.ly的服务来缩短他们网站的链接。 当拥有用户名的页面变成“ fb.me/”时,与Facebook相关的其他链接变成“ on.fb.me/***** ”。 要使用on.fb.me服务,只需使用您的Bit.ly帐户即可。 请注意,如果您将Bit.ly帐户上的默认链接缩短器从bit.ly更改为j.mp,则此服务将无法使用。 Facebook uses Bit.ly's services to shorten links from their site. While ... -
没有简单的方法可以做到这一点,因为帖子和广告之间没有任何关联。 最简单的方法可能是请求帐户的所有广告素材及其object_story_id: /
/act_ /adcreatives?fields=object_story_id 然后请求帐户中的所有广告以及广告素材和参考是否匹配: / /act_ /ads?fields=id,creative There is no simple way to do this as there ... -
我正在寻找相同的功能。 我想你将不得不订阅以下事件并自己处理通知过程。 FB.Event.subscribe('comment.create', function() {} I am looking for the same feature. I think you would have to subscribe to the following event and handle the notification process yourself. FB.Event.subscribe('comment. ...
-
获取我的FB页面的通知(Get notifications for my FB page)[2022-09-23]
你可以试试iOS的facebook sdk。 对于页面中的展示帖子,您可以通过Facebook对象请求$ {pageId} / feed。 这样的事情。 这是页面对象 。 [facebook requestWithGraphPath:@"pageId/feed" andDelegate:self]; 推送通知,您必须通过选中相同的$ {pageId} / Feed来检查服务器中是否每2分钟有一个新的Feed。 如果$ {pageId} / Feed中有新帖子,您可以将内容推送给粉丝。 从iphone中的$ ... -
通知只能发送,之后无法以任何方式访问。 没有API。 没有 没有 Notifications can only be sent, you cannot access them after that in any way. There is no API for it. No No
-
您正在以错误的方式拨打电话,您必须提供其他parameters例如应用访问令牌,模板等,您的应用应该是一个canvas app 有关更多详细信息,请参阅开发人员网站上的Notifications API教程,他们详细说明了如何使用此API作为示例(非常简单) 此外,您正在发出GET请求(默认情况下)而不是POST (您必须明确提及该方法),这就是为什么而不是发布您只是得到结果。 代码示例 : FB.api('/RECEIPIENT_USERID/notifications', 'post', ...
-
FB喜欢按钮 - 未找到页面(FB like button - page not found)[2022-05-08]
我已经尝试了fb对象调试器,结果是,og:标题丢失了,所以在我添加它之后就可以了。 https://developers.facebook.com/tools/debug/og/object/ 此外,它可能是一些fb缓存的问题(也可以通过从对象调试器获取新信息来解决) I've tried fb object debugger and turns out, that og:title is missing, so after I add it it works. https://developers.fac ... -
Android应用程序添加功能,以fb页面和评论fb帖子(android app add functionality to like fb page and comment on fb posts)[2023-08-03]
要“喜欢”一篇文章: 就像是: Facebook mFacebook = new Facebook(); mFacebook.request(THE_POST_ID + "/likes", parameters, "POST"); 要对帖子“发表评论” : Bundle parameters = new Bundle(); parameters.putString("message", edtComment.getText().toString()); mFacebook.request(THE_POST ... -
将评论放在fb页面上(Putting the comment on a fb page)[2024-02-14]
我得到了解决方案,我正在使用GET请求,而是使用POST请求 post_id/comments?message=Test Comment. 它将返回新的评论ID。 I got the solution, i was using GET request , instead use POST request post_id/comments?message=Test Comment. It will return the new comment ID.