BorgChick
BorgChick

Reputation: 1

sed repetition-operator operand invalid *****

I have text files that contain ***** in some locations. I need to replace the ***** with 9.999. This obviously came from some formatting error, but I do not have the program that created the files I now have to work with. I tried using the following command in csh:

sed -i "" 's/*****/9.999/g' *.dat

However, as I expected, I get the following error message:

sed: 1: "s/*****/9.999/g": RE error: repetition-operator operand invalid

I'm assuming this is because ***** is considered a special operator or something like that, but I can't figure out how to exempt them while using the sed command.

Does anyone have a hint that could help?

Upvotes: 0

Views: 1321

Answers (1)

Ed Morton
Ed Morton

Reputation: 203532

sed -E 's/\*{5}/9.999/g'  file 

Upvotes: 3

Related Questions