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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -