【发布时间】:2012-04-18 09:20:03
【问题描述】:
我正在使用来自How to restrict grep to search only the one column within a CSV file, but to output matching lines in their entirety? 的答案用 awk 搜索特定列,然后输出匹配的行,例如:
awk -F@ "{if (\$2 ~ /$find_me/ ) { print \$0; } }" <input_file>
- 如何将搜索限制为仅匹配列与
$find_me完全匹配的行? - 如何将搜索限制为仅输出文件中找到的第一个匹配项?
【问题讨论】: