You are not logged in.
Pages: 1
Hi,
How would I remove anything between brackets using a sed command. Eg:
<tr><td>foo</td> <td>bar</td></tr>
would turn into:
foo bar
I tried sed "s#\<.*\>##g" but that remove everything from the first "<" to the last ">". How do I match the first ">"?
Thanks
Offline
Would this do :
sed "s#<[^>]*>##g
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
Offline
How about this:
stuff
/*Multi line
comment */
more stuff
/*more comments*/
to
stuff
more stuff
Offline
from: http://lists.samba.org/archive/linux/20 … 04283.html
It's not a 1-liner sed, but it seems to work.
strip-c-comments.sh
#!/usr/bin/sed -f
# if no /* get next
/\/\*/!b
# here we've got an /*, append lines until get the corresponding
# */
:x
/\*\//!{
N
bx
}
# delete /*...*/
s/\/\*.*\*\///
You'd run it like:
$ cat test.html | ./strip-c-comments.sh
Offline
wow.
cool thanks.
but wow.
Offline
Pages: 1