You need to use something like vim
instead of nano
.
Open the file using vim and press esc and then type:
:s/<br>/\r\t/g
and then press enter
To save the file and exit, run the following sequence of keys which will write the file (save) and quit vim
:
press esc and then type:
:wq
and then press enter
Click here to view a related question which explains why this cannot be done using nano.
Alternatively, you could use sed
to edit the file.
Here is an example:
I will use the example filename "HELLO":
sed -i 's/<br>/\n\t/g' HELLO
Furthermore, if you want to create a file instead, you can run the following command to create the file by piping the output of sed
to a file using tee
:
echo 'Hello<br>Hello<br>Hello' | sed 's/<br>/\n\t/g' | tee HELLO