I have a big file contains many lines in the following format,
<SomeString1>Key1</SomeString>
<SomeString2>Key2</SomeString>
<SomeString3>Key3</SomeString>
...
I want to remove the tags, and the output should look like,
Key1
Key2
Key3
...
Algorithmically, I should write something like:
For all lines:
Remove all string before character `>`
Remove all string after character `</`
Simply use a replace regex:
This will apply the
s
(substitution) command for each line (%
) and remove all<...>
sequences for the entire line (g
).There are many situations in which these commands come in handy, especially using regex. You can find more information about it here.