linux - Search for columns ending with certain pattern, then delete that column -
i need search line of numbers columns end 999 , delete entire column while preserving leading number (i.e. 8599999.... --> 85)
data line:
66 72 79 84 87 90 91 92 92 93 92 91 89 85999999999999999999999999999999999
desired output:
66 72 79 84 87 90 91 92 92 93 92 91 89 85
using sed
$ echo '66 72 79 84 87 90 91 92 92 93 92 91 89 85999999999999999999999999999999999' | sed 's/999\+//g' 66 72 79 84 87 90 91 92 92 93 92 91 89 85
999\+
999 followed number of consecutive 9s
Comments
Post a Comment