removing the words with symbols in a file in unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting removing the words with symbols in a file in unix
# 1  
Old 04-26-2012
removing the words with symbols in a file in unix

I have file like below

Code:
Hi iam author <br>joseph</br> in france.
I live in my home <br></br> but no food.
I will play footbal <br></br> but i wont play cricket.
I will read all the books <br>all fiction stories</br> i hate horror stories.

I want output like below

Code:
Hi iam author <br>joseph</br> in france.
I live in my home but no food.
I will play footbal but i wont play cricket.
I will read all the books <br>all fiction stories</br> i hate horror stories.

I want to delete the tag following tag "<br></br>" in all the line.Thanks in advance please help me.

Last edited by methyl; 04-26-2012 at 05:41 PM.. Reason: please use code tags
# 2  
Old 04-26-2012
How about:
Code:
sed 's:\<br\>\<\/br\>::g' input.file > output.file

Or you can try:
Code:
sed -i -e 's:\<br\>\<\/br\>::g' input.file

This User Gave Thanks to brianjb For This Post:
# 3  
Old 04-26-2012
Try:
Code:
sed 's|<br></br>||g' infile

# 4  
Old 04-27-2012
Thanks all it works. Thank you very much.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Removing unwanted symbols with sed

I would like produce blue, green, red, yellowfrom"blue:,*green:,*red:,*yellowI can remove the colon with echo "blue:,*green:,*red:,*yellow" | sed 's/://g'which givesblue,*green,*red,*yellowbut when I try echo "blue:,*green:,*red:,*yellow" | sed 's/://g'; 's/*//g'I get bash: s/*//g: No such... (9 Replies)
Discussion started by: Xubuntu56
9 Replies

2. Shell Programming and Scripting

Using key words or symbols to determine parser

There are multiple conditions in which the user can input data. 1. > 2. del 3. ins 4. delins The user input is saved in a specific directory using the code below: Code: cd 'C:' C:/Users/cmccabe/Desktop/Python27/python.exe C:/Users/cmccabe/Desktop/Python27/run_batch_job.py... (12 Replies)
Discussion started by: cmccabe
12 Replies

3. Shell Programming and Scripting

Add words in beginning , end after removing a word in a file

My file has the entries like below... /dev/sds /dev/sdak /dev/sdbc /dev/sdbu I want to make the file like below echo 1 > /sys/block/sds/device/rescan echo 1 > /sys/block/sdak/device/rescan echo 1 > /sys/block/sdbc/device/rescan echo 1 > /sys/block/sdbu/device/rescan (2 Replies)
Discussion started by: saravanapandi
2 Replies

4. UNIX for Dummies Questions & Answers

sed command for removing symbols

Hi I am trying to remove all the symbols in a file (testfile1) and using the below command to do that. Its not working for me. Can you help me on what is wrong with below script? I want to retain only alphabets in a file and remove all the symbols like *:.+= etc sed 's/^.//g' testfile1 > testfile2 (4 Replies)
Discussion started by: sandeepcm
4 Replies

5. Shell Programming and Scripting

How to search and append words in the same file using unix scripting file operations

Hi , I have a file myhost.txt which contains below, 127.0.0.1 localhost 1.17.1.5 atrpx958 11.17.10.11 atrpx958zone nsybhost I need to append words only after "atrpx958" like 'myhost' and 'libhost' and not after atrpx958zone. How to search the word atrpx958(which is hostname) only,... (5 Replies)
Discussion started by: gsreeni
5 Replies

6. Shell Programming and Scripting

Conditional removing of words from a line

Hi , I have a .csv file,from which I want to remove some data from each column as below. Source Data GT_12_AUDIT,SCHEDULED,NOZOMI2010/GT_12_AUDIT,CTSCAN/Zh_GT_6547887/GT_12_AUDIT,CTSCAN/Zh_GT_6547887... (3 Replies)
Discussion started by: gaur.deepti
3 Replies

7. Shell Programming and Scripting

Removing Symbols From a File like the copyright symbol

Hi guys, I have a txt file full of funny symbols like the copyright symbol and other funny ones that get in the way when trying to use sed. For example, not sure if you can read this but I have a line that looks like this: 24(9):995Â*1001 DOI: 10.1007/s11606-009-1053-2 © When I'm using... (1 Reply)
Discussion started by: joshdg
1 Replies

8. Shell Programming and Scripting

Removing identical words in column

I have a file that needs to be cleaned up. Here is the file: Project Project John Project Gary Project Sean Project2 Project2 Lisa Project2 Tyler Project2 Sam Project3 Project3 Mike Project3 Bran I need the o/p to be: Project John Gary Sean Project2 (7 Replies)
Discussion started by: leepet01
7 Replies

9. Shell Programming and Scripting

removing 2 words from file.

Hi All, I have a text file with name of source files in that. source files ends with .mxml and .css. Now I want to remove the extensions of these source files. Currently I can do so by writing 2 sed commands, as there are files with just 2 different extensions. But I want to do it in one sed... (6 Replies)
Discussion started by: mkashif
6 Replies

10. Shell Programming and Scripting

deleting symbols and characters between two words

Hi Please tell me how could i delete symbols, whitespaces, characters, words everything between two words in a line. Let my file is aaa BB ccc ddd eee FF kkk xxx 123456 BB 44^& iop FF 999 xxx uuu rrr BB hhh nnn FF 000 I want to delete everything comes in between BB and FF( deletion... (3 Replies)
Discussion started by: rish_max
3 Replies
Login or Register to Ask a Question