Extract First character in Second column

Hi,

I need to extract the first character of second column of my file. If the condition matches, then I need to print the 2nd and 3rd column as my output

I tried below mentioned query but it was not working

 
awk -F'|' '$2~/^5/' Sgn_group.txt

File Name : Sgn_group.txt

 
country code address
SG|567|jalal street
SG|456|petaling
SG|587|Srinagar

Output:

567|jalal street
587|Srinagar

kindly help me how can I get this output.

Hello,

Following may help you in same.

awk -F"\|" 'NR==1{next} {match($2,/./); char=substr($2,RSTART,RLENGTH)} {if(a ~ char){print $2 OFS $3}}' a="5" OFS="\|" match_2nd_col_check12113

Output will be as follows.

567|jalal street
587|Srinagar

Thanks,
R. Singh

awk -F'|' '$2~/^5/ { print $2 FS $3 } ' file
sed -n "s/^[^|]*|5/5/p" file