Entering edit mode
2.6 years ago
zhousun21
▴
40
Hi all,
Basic sed question:
This sed substitution works fine to replace a string of Ns with a Z:
cat test1 | sed -E "s/N{10}/Z/g"
But the reverse replaces a Z with the literal string "N{10}"
cat test2 | sed -e "s/Z/N{10}/g"
and returns something like this:
AAAAN{10}CCCCCC
I've tried to to this a variety of ways, but can't find anything that works.
Any advice will be appreciated.
what is the question ?
How can I replace a "Z" with 10 Ns?
(Note: I can just type in 10 Ns in the sed command, but I'm trying to understand the syntax.)
as far as I know, there is no 'print x time operator' in sed.
You could use command substitution to insert a bash
seq
operation as long as thesed
substitution was softquoted I think, but its a hack