I have text file with values as:1 Peter2 PaulI need a command/scipt that will take as a parameter value from the second column (e.g. Paul) and return the corresponding value from the first one (2).I'm trying to use while loop, but how can find the value I need:while IFS= read -a line; do        printf %s\n ${line[@]}     done < file.txt
Find value in one column and print corresponding value from other one
shell script;text processing
With GNU grep:grep -Po .* (?=Paul) fileOutput:2or with bash:while read -r num name; do  [[ $name == Paul ]] && printf %s\n $numdone < file