I am trying to extract/isolate certain values in a string:
String
1:0:lon=288.987370,lat=42.353930,i=2035360,ix=1900,iy=949,val=36.2434
Say, for instance, I want to extract the value of ix
, which is 1900.
I am guessing this can be accomplished through awk
or sed
.
Attempted Code
echo "1:0:lon=288.987370,lat=42.353930,i=2035360,ix=1900,iy=949,val=36.2434" | awk -F'=' '{print $4}' | awk -F',' '{print $1}'