gpt4 book ai didi

linux - Grep 从 CSV 文件中获取特定列的最新值

转载 作者:太空宇宙 更新时间:2023-11-04 04:46:54 25 4
gpt4 key购买 nike

"cola","colb","colc","cold","cole","colf""a","b","c","d","e","f""a1","b1","c1","d1","e1","f1""a2","b2","c2","d2","e2","f2"

假设这是 CSV 文件,我想要 grep"e"来自专栏"cole"并将其存储到 shell 变量中。然后使用 shell 变量作为 wget 的一部分命令。

我该怎么做?

最佳答案

set -f         # disable globbing
variable="$(awk 'NR==2 {print $5}' file)"
set +f

关于linux - Grep 从 CSV 文件中获取特定列的最新值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29780332/

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