How to use sed to remove some characters from file?

fairman

I have this code in some file

<pre class="bbCodeCode" dir="ltr" data-xf-init="code-block" data-lang=""><code>-Fix numcer one/Two
-EMM Support
-Fix update &lt; broken
-Add support patch</code></pre>
</div>
</div><b><br />

I need to remove some characters and keep just this code

-Fix numcer one/Two
-EMM Support
-Fix update &lt; broken
-Add support patch

I have try this code

#!/bin/bash
sed -n '/>-/,/</p' /home/Desktop/1 > /home/Desktop/2
sed -n '/^-*code>/p' /home/raed/Desktop/2  > /home/Desktop/3
sed -i 's#</code></pre>##' /home/Desktop/3
exit

But the code remove first line

-Fix numcer one/Two
steffen

Try this

sed 's/<[^>]*>//g' <file

It will remove everything between < and the next > (linewise).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

how to remove some characters from string?

Remove characters from string with sed

How to use sed or another command line function to remove . between characters

How can I properly use sed to remove text outside "" characters?

I want to use memset to remove some characters from string

How to remove special characters from text file

How to use grep/sed/awk, to remove a pattern from beginning of a text file

Use batch file to remove special characters from csv file

how to use sed to replace from last 3 characters from string

How do I remove some characters from my String

how to remove classes ending with some characters from elements

How To Remove Characters from String based on Some Conditions

How to use 'sed' to add characters to beginning of line in a file

Use "sed" to Remove Capture Group 1 From All Lines In a File

Use sed to remove characters in front of matching keywords

sed find line in file and remove characters

How to use sed to remove the last n lines of a file

How can I use sed to remove the first paragraph of the file?

How To Remove Some Characters from a String in Python or just Extract some lines from it?

Remove Strings from two patterns/characters with sed

sed: remove numbers from file

sed remove first two characters if some string existed

How to use sed to remove variables value from a string

How to remove specific numbers from a txt file with SED or AWK?

How to remove all versions from requirement file with bash "sed"

How to remove repeated lines from file with awk/sed?

How to remove a script tag from a text file with sed

How can I replace some characters with `'` character in a text file using sed?

remove numbers and characters from file