Latest Posts
Tags
awk awk examples awk gsub awk substr background run script bash awk curl disk space docker commands docker usage du find and grep find examples Google Analytics grep examples head examples java java example linux awk linux command linux grep linux ls ls -a ls -al ls examples ls sort ls sort by size mkdir mv examples mysql mysql column to row mysql example PlantedTank rm sed sed examples sed tutorial seo Shell tutorial top vim vim examples vim tutorial w wordpress
Tag Archives: awk NR FNR
awk merge files base on the keyword
use the awk variables NR and FNR merge files base on the keywords.
awk -F’ ‘ ‘NR==FNR{a[$1]=$2;}NR!=FNR{print $0, a[$1]}’ test-4.txt test-5.txt Continue reading
Posted in Awk Command, Text Processing
Tagged awk examples, awk merge files, awk NR FNR, linux awk
Comments Off on awk merge files base on the keyword
awk NR FNR difference
Linux awk command can use variables NR and FNR to process multiple files. NR : ordinal number of the current record, multiple files self-increase FNR : ordinal number of the current record in the current file awk NR example Processing … Continue reading