awk one liner select only rows based on value of a column
awk, linux, unix
Solution
awk -F"\t" '$2 == "victorian" { print $1"\t"$3 }' file.in
Problem
I'd like to read filein.txt (tab delimited) and output a fileout.txt with only rows that match the value of a given column, and eliminate the column being queried. i.e., ``` filein.txt #name\thouse\taddress roger\tvictorian\t223 dolan st. maggie\tfrench\t12 alameda ave. kingston\tvictorian\t224 house st. robert\tamerican\t22 dolan st. ``` Let us say I'd like to select only the rows where the houses are of `victorian` style, then my fileout.txt should look like: ``` fileout.txt #name\taddress roger\t223 dolan st. kingston\t224 house st. ```