sed: regular expression,how to substitute?

elbarna

I have those line on a text file

36) 
SIGCANCEL
37) 
SIGLOST
38)
SIGXRES
39)
SIGJVM1
40)
SIGJVM2
41)
SIGRTMIN
42)
SIGRTMIN+1
43)
SIGRTMIN+2
44)
SIGRTMIN+3
45)
SIGRTMAX-3
46)
SIGRTMAX-2
47)
SIGRTMAX-1
48)
SIGRTMAX

I want to substitute using sed so the lines become

SIGRTMAX-3
SIGRTMAX-2
SIGRTMAX-1

I have tried those commands,but none work

sed s/^[0-9]\)//g
sed s/^[0-9])//g

also using the -e switch produce nothing.

Uriel

Substitute is not needed, you can simply delete lines starting by a digit :

sed '/^[0-9]/d'

And if you really must use substitution :

sed 's/^[0-9].*//'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to substitute a character or expression for a newline using sed?

From Dev

How to substitute a character or expression for a newline using sed?

From Dev

substitute n'th expression with sed

From Dev

How to match and partial substitute with sed

From Dev

Regular expression to substitute a pattern in VB script

From Dev

Ignoring middle group in regular expression substitute

From Java

How to create regular expression to substitute strings surrounded by parentheses?

From Dev

the use of "+" in sed regular expression

From Dev

sed regular expression failure

From Dev

sed with regular expression

From Dev

the use of "+" in sed regular expression

From Dev

Regular expression with sed

From Dev

sed regular expression extraction

From Dev

sed command with regular expression

From Dev

Negation of sed regular expression

From Dev

Sed Regular Expression with /P

From Dev

+ Regular Expression not working in sed

From Dev

How to match everything but a regular expression with sed?

From Dev

How to use [\w]+ in regular expression in sed?

From Dev

How to match everything but a regular expression with sed?

From Dev

sed: how to insert a newline into a regular expression?

From Dev

How to get sed to substitute for all but one character

From Dev

How to get sed to substitute for all but one character

From Dev

sed how to substitute when string has "http://" in it?

From Dev

How to use sed to substitute strings which has "\" in it?

From Dev

how to substitute slash in a file using sed

From Dev

Regular expression one liner that knows if a substitute variable is filled

From Dev

Javascript write regular expression to substitute http with html tag

From Java

Escaping plus in sed regular expression

Related Related

  1. 1

    How to substitute a character or expression for a newline using sed?

  2. 2

    How to substitute a character or expression for a newline using sed?

  3. 3

    substitute n'th expression with sed

  4. 4

    How to match and partial substitute with sed

  5. 5

    Regular expression to substitute a pattern in VB script

  6. 6

    Ignoring middle group in regular expression substitute

  7. 7

    How to create regular expression to substitute strings surrounded by parentheses?

  8. 8

    the use of "+" in sed regular expression

  9. 9

    sed regular expression failure

  10. 10

    sed with regular expression

  11. 11

    the use of "+" in sed regular expression

  12. 12

    Regular expression with sed

  13. 13

    sed regular expression extraction

  14. 14

    sed command with regular expression

  15. 15

    Negation of sed regular expression

  16. 16

    Sed Regular Expression with /P

  17. 17

    + Regular Expression not working in sed

  18. 18

    How to match everything but a regular expression with sed?

  19. 19

    How to use [\w]+ in regular expression in sed?

  20. 20

    How to match everything but a regular expression with sed?

  21. 21

    sed: how to insert a newline into a regular expression?

  22. 22

    How to get sed to substitute for all but one character

  23. 23

    How to get sed to substitute for all but one character

  24. 24

    sed how to substitute when string has "http://" in it?

  25. 25

    How to use sed to substitute strings which has "\" in it?

  26. 26

    how to substitute slash in a file using sed

  27. 27

    Regular expression one liner that knows if a substitute variable is filled

  28. 28

    Javascript write regular expression to substitute http with html tag

  29. 29

    Escaping plus in sed regular expression

HotTag

Archive