gpt4 book ai didi

linux - 在多个语料库上 Grep 多个关键字的快速方法

转载 作者:太空宇宙 更新时间:2023-11-04 09:47:42 26 4
gpt4 key购买 nike

我有 13K 术语的列表,我想识别它在 24K 文本文件中的存在。所以最后我想要 terms->file names 上下文。

使用 Unix/bash 命令实现此目的的最佳方法是什么?

我可以像这样使用 Perl 脚本,但是太慢了:

#!/usr/bin/perl 
#....skip...
foreach my $term (@terms) {
system("grep $term /corpus/*.txt/")
}

最佳答案

grep --fixed-strings --word-regexp --with-filename --file=terms.txt --recursive /corpus

关于linux - 在多个语料库上 Grep 多个关键字的快速方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14493598/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com