搜索短语列表 [英] Searching for List of Phrases

查看:161
本文介绍了搜索短语列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有要从配置文件中读取的搜索短语列表,也有一个包含子文件夹和文件列表的文件夹,我需要在其中搜索所有搜索短语,并准备平面文件输出,如下所示.

在给定的文件夹中搜索词组不匹配
-----------------------------------------------
短语1 20
短语2 45
.
.
.

我有一个解决方案,.Net控制台应用程序从配置文件中读取短语,并使用findstr dos命令获取搜索结果并写入平面文件.

I have list of search phrases to be read from a config file, also I have a folder with list of subfolders and files in which i need to search all the search phrases, and prepare a flat file output, some thing like below.

Search Phrase No Of Matches in the given folder
-----------------------------------------------
Phrase1 20
Phrase2 45
.
.
.

I have one solution with .Net console application reading the phrases from config file and using findstr dos command to get the search results and write to the flat file.

Can any one provide a better solution, something like PERL script etc, which should be fast in preparing the output?

推荐答案

您可以在其中使用正则表达式形式吗?控制台应用程序为您执行此操作-我不确定为什么您需要使用findstr.这可能帮助 [
You may be able to use regular expressions form within the console application to do this for you - I''m not sure why you''d need to use findstr. This may help[^].


这篇关于搜索短语列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆