My input text is in this format
aa5b r1 12715
r2 12221
aa43b ew 13721
eb 122331
aa4b ff 1055440
Output must be
aa5 r1 12715
r2 12221
aa43 ew 13721
eb 122331
aa4 ff 1055440
I tried with
awk -F " " '{print $1}' t1 | grep "^aa*" > t2|sed s/b//g t2
The problem with this code is that the input text is not having a fixed pattern.
What about this version with
sed?