如何读取csv文件并用逗号分隔它们

How to read csv file and split them by comma

这是示例输入

Pat,Stay,7,14
Sam,Pere,3,16

我想要像 14-7 和 16-3 这样的子集,如果值大于 10,我想打印名称。

输出

sam

假设 input.txt 有这些字符串。您可以像这样使用 awk:

awk -F ',' '{if(- > 10) print }' input.txt