Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • I understand that the s means substitute and the forward slashes are delimiters, but what do the following commands mean? :a; \+ and ; ta Commented Sep 10, 2013 at 20:19
  • :a is a label, ta means "go to a": in short, it is a loop Commented Sep 10, 2013 at 20:31
  • 1
    And sed 's/ [[:digit:] ]\+ / /' can do it the same Commented Sep 10, 2013 at 20:34
  • 1
    I was thinking along the lines of enzotib, but went with sed 's/[[:space:]][[:digit:]]\+//g' which removes one or more numbers [[:digit:]]\+ proceeded by whitespace (tabs, spaces) [:space:], and also specified /g to the options, to do it for all occurrences (and not just the first) Commented Sep 10, 2013 at 20:41
  • The reason I searched for the trailing space in a loop was to avoid matching " 123abc" -- i.e. to ensure that the word was composed only with digits. Commented Sep 11, 2013 at 12:41