Groups | Search | Server Info | Login | Register


Groups > comp.os.linux.misc > #56859

Re: How can I use sed to insert a character into a file?

From Fritz Wuehler <fritz@spamexpire-202407.rodent.frell.theremailer.net>
Subject Re: How can I use sed to insert a character into a file?
References <v6hc36@dont-email.me>
Message-ID <0e5c2fc463ca61baeed61bb8340a9658@msgid.frell.theremailer.net> (permalink)
Date 2024-07-09 16:26 +0200
Newsgroups comp.os.linux.misc
Organization dizum.com - The Internet Problem Provider

Show all headers | View raw


Jon Danniken <nones...@nottodaynortomorroreither.org> [JD]:
JD> <type:color>000000</type:color>
JS> <type:color>FFFFFF</type:color>

JD> the tags are hex colors ... but need to begin with a pound sign (#)


# append a pound sign after the first instance of ">"
< file sed 's@>@&#@'


Or, if you are a fan of 'awk'

# replace the first instance of ">" with ">#" and print the line
< file awk '{sub(">",">#")}1'

Back to comp.os.linux.misc | Previous | Next | Find similar


Thread

Re: How can I use sed to insert a character into a file? Fritz Wuehler <fritz@spamexpire-202407.rodent.frell.theremailer.net> - 2024-07-09 16:26 +0200

csiph-web