Removing Symbols From a File like the copyright symbol


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Removing Symbols From a File like the copyright symbol
# 1  
Old 03-06-2011
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 sed to grab parts of this, the funny symbols don't match any regex symbols, even '.'. Like, if I said
Code:
sed -n '/^.*$/p' < example.txt

, then only lines that didn't contain funny symbols would match. Is there a way to get rid of those symbols so that I can get at those lines?

Thanks
# 2  
Old 03-06-2011
Code:
perl -lape 's/[^[:print:]]*//g' list

This User Gave Thanks to rdcwayx For This Post:
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. 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

3. Shell Programming and Scripting

removing the words with symbols in a file in unix

I have file like below 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 Hi iam author... (3 Replies)
Discussion started by: vinothsekark
3 Replies

4. Shell Programming and Scripting

Extra symbols when vi a file

When i try to vi a file, see some extra characters "l^H^@^@^@^@^F^@"...but when i cat the same file i am not seeing this...How do i remove this??? (4 Replies)
Discussion started by: problemchild
4 Replies

5. Shell Programming and Scripting

Print new item in file with symbol

Dear all, I have encountered some problem here. I prompt the user for input and store it into a data file, eg. key in name and marks so the data file will look like this andrew 80 ben 75 and the next input is carine 90. So the problem here is i want to print... (2 Replies)
Discussion started by: branred
2 Replies

6. Solaris

/usr/lib/passwdutil.so.1: symbol __nsl_fgetspent_r: referenced symbol not found

deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies

7. Shell Programming and Scripting

How to make a £ symbol printed from a file?

Hi, I am working on Solaris and facing a problem. I have a .DAT file which simply contains some data in particular format which includes £ symbol. The fomat looks like 001|£30VB | | |T+T250|£30 Value Bundle |1|1|1 |0 |0|0 | |0|1010906 |93731 |TREVORJ |CRBCE1P |1090713 |134739 |JAMESMAT... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

8. Shell Programming and Scripting

Remove the comment symbol ' from a file.

I want to remove the commented lines in a file identified by ' symbol at the start of each ine. A sample example will be like: Input ----- 'IFerr_flag=0THEN iferr_flag=0then iferr_flag=0then iferr_flag=0then iferr_flag=0then iferr_flag=0then iferr_flag=0then Output -------... (3 Replies)
Discussion started by: joyan321
3 Replies

9. Shell Programming and Scripting

Urgent: How to eliminate special symbols in a file and how to read it

Hi, I have file called suppliersList.txt --------------------------------- 112|MIMUS|krish@google.com 113|MIMIRE|krish@google.com 114|MIMCHN|krish@google.com 115|CEL|krish@google.com 108|UGEN|krishn@google.com 109|SLAND|krish@google.com i have 3 varibale ------------- no Name... (4 Replies)
Discussion started by: kittusri9
4 Replies

10. UNIX for Dummies Questions & Answers

Copyright Symbol?

Anyone know how to have the copyright symbol display without using the '@' sign or the '(c)' key combinations? Is it available? Not important, just my a... retentive side wishing to shore up some scripts with a true copyright symbol. (2 Replies)
Discussion started by: spieterman
2 Replies
Login or Register to Ask a Question