Find value from one csv in another one (like vlookup) in bash (Linux)

前端 未结 4 1943
猫巷女王i
猫巷女王i 2021-01-03 16:38

I have already tried all options that I found online to solve my issue but without good result.

Basically I have two csv files (pipe separated):

file1.

4条回答
  •  被撕碎了的回忆
    2021-01-03 17:31

    A little approach, far away to be perfect:

    DELIMITER="|"
    
    for i in $(cut -f 7 -d "${DELIMITER}" file1.csv ); 
    do 
        grep "${i}" file2.csv | cut -f 3 -d "${DELIMITER}"; 
    done
    

提交回复
热议问题