Sed to delete lines that with the following

Hi,

I'm very new to Sed and I have a very large file that contains data in the following way

(*064) 1    4  10
(*064) simulation time =  0.12000E-05
(*064) 1    2  10
(*064) 1    3  10

Essentially what I want to do it delete every line that starts with

'(*064) 1'

I tried the following,

sed '/^(*064) 1/d' filename

But this doesn't work. I'm not sure whether this is because the start of the line contains special characters (forward bracket and the asterix) or whether there is a space before 1.

How would I do it?

Thanks

sed '/^(\*064) 1/d' filename

You need to escape the *

1 Like
grep -v '^(\*064) 1' filename
1 Like