Im trying to read a file for those lines which has IP address on the first column.
my command below does not return any value.
cat test.csv | awk '$1 == "^[[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}]" { print $0 }'
The regex can capture IP address.
Tried the below too,
cat test_1.csv | awk '$1~/^[[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\]/ {print $0}'
test.csv
1.1.1.1 ipaddress gateway
2.2.2.2 ipaddress_2 firewall
www.google.com domain google