Skip to main content
deleted 17 characters in body
Source Link
oliv
  • 2.6k
  • 11
  • 15

Using awk:

awk -F', *' -v OFS=',' 'NR==FNR{a[$1]=$2;next}NR>FNR{print $0 a[$4]}' CountryCode.csv ListIPv6.csv

The array a is filled with lines of the file CountryCode.csv and then the other file is displayed together with the entries of the array.

Using awk:

awk -F', *' -v OFS=',' 'NR==FNR{a[$1]=$2;next}NR>FNR{print $0 a[$4]}' CountryCode.csv ListIPv6.csv

The array a is filled with lines of the file CountryCode.csv and then the other file is displayed together with the entries of the array.

Using awk:

awk -F', *' 'NR==FNR{a[$1]=$2;next}{print $0 a[$4]}' CountryCode.csv ListIPv6.csv

The array a is filled with lines of the file CountryCode.csv and then the other file is displayed together with the entries of the array.

Source Link
oliv
  • 2.6k
  • 11
  • 15

Using awk:

awk -F', *' -v OFS=',' 'NR==FNR{a[$1]=$2;next}NR>FNR{print $0 a[$4]}' CountryCode.csv ListIPv6.csv

The array a is filled with lines of the file CountryCode.csv and then the other file is displayed together with the entries of the array.