Code:
BEGIN {
FS="[ .]"
}
/GH[12]/ {
str = $1=="GH1" ? "The world is round" : "Today is my birthday"
printf "%s %s.%s.%.1s\n", str, $2, $3, $4
}
Or the same as a one-liner:
Code:
awk -F'[ .]' '/GH[12]/ {str=$1=="GH1"?"The world is round":"Today is my birthday";printf "%s %s.%s.%.1s\n",str,$2,$3,$4}' your.file