Sponsored Content
Top Forums UNIX for Dummies Questions & Answers sed command for removing symbols Post 302760337 by sandeepcm on Thursday 24th of January 2013 12:54:25 AM
Old 01-24-2013
Ubuntu 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/^[a-zA-Z].//g' testfile1 > testfile2
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

new lines symbols in sed?

I want to edit a huge script file using sed. How can I add the new lines symbols in the red colored places? sed -e "s/test -z "$x"/if test -z "$x" then echo -1; \n else \n/g" (1 Reply)
Discussion started by: gogogo
1 Replies

2. Shell Programming and Scripting

How to replace symbols by position using SED

Hi all, I need your help. For example I have string in file.txt: -x -a /tmp/dbarchive_NSS_20081204 -f 900 -l 1 2008/12/04 2008/12/04 So, I need to replace symbols from (for e.g.) position 26 till 33 with symbols which I have in file replace.txt And I have no idea how to do it. If... (1 Reply)
Discussion started by: nypreH
1 Replies

3. Shell Programming and Scripting

remove accents and symbols with sed

Hi, I would like to know how could I remove accentes and the symbols: º and ª of a text file with sed. Whis this command doesn't works :-( sed "s/í/i/g" filename Many thanks and sorry for my english! (7 Replies)
Discussion started by: mierdatuti
7 Replies

4. Shell Programming and Scripting

SED removing CR/LF

I have a source text file that contains something like this: <start_template> bool function( void *<var_name> ) { // Blah Blah } </start_template> Following is used to remove this template from source file. template=$(sed -n -e '/<start_template>/,/<\/start_template>/{... (4 Replies)
Discussion started by: gee22
4 Replies

5. Shell Programming and Scripting

Problem with using a sed to add escape character \ before $ and ' symbols

Hi all, I've got a problem with sed. Want to use it to add escape character \ before $ and ' symbols so condition='1'$some will become condition=\'1\'\$some echo "condition='1'$some" | sed 's/\($\)/\\\1/g' is not working properly. Can somebody help me with this please? Regards,... (7 Replies)
Discussion started by: johny_be_good
7 Replies

6. 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

7. 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

8. Answers to Frequently Asked Questions

How to prevent sed command removing whole line?

hello, I'm using sed command to extract the text between 2 special characters which are /* and */ I used following command to do this. sed -n '/\/\*/,/\*\//p' file.txt But if the file.txt contains a line something like this, a=5; /* this is a comment */ the above command... (3 Replies)
Discussion started by: beginner_99
3 Replies

9. Shell Programming and Scripting

Sed, how replace specific symbols between two patterns

I have a big xmltv file with many lines like: <?xml version="1.0" encoding="UTF-8"?> <tv> <channel id="channel 1 +3HD"> <display-name lang="it">channel +3HD</display-name> <icon src="http://mywebsite.com/dsgbnjfdc65657/channel +3HD.png" /> ... (8 Replies)
Discussion started by: Tapiocapioca
8 Replies

10. 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
STRIP(1)						       GNU Development Tools							  STRIP(1)

NAME
strip - Discard symbols from object files. SYNOPSIS
strip [-F bfdname |--target=bfdname ] [-I bfdname |--input-target=bfdname ] [-O bfdname |--output-target=bfdname ] [-s|--strip-all] [-S|-g|-d|--strip-debug] [-K symbolname |--keep-symbol=symbolname ] [-N symbolname |--strip-symbol=symbolname ] [-x|--discard-all ] [-X |--discard-locals] [-R sectionname |--remove-section=sectionname ] [-o file ] [-p|--preserve-dates] [-v |--verbose] [-V|--version] [--help] objfile... DESCRIPTION
GNU strip discards all symbols from object files objfile. The list of object files may include archives. At least one object file must be given. strip modifies the files named in its argument, rather than writing modified copies under different names. OPTIONS
-F bfdname --target=bfdname Treat the original objfile as a file with the object code format bfdname, and rewrite it in the same format. --help Show a summary of the options to strip and exit. -I bfdname --input-target=bfdname Treat the original objfile as a file with the object code format bfdname. -O bfdname --output-target=bfdname Replace objfile with a file in the output format bfdname. -R sectionname --remove-section=sectionname Remove any section named sectionname from the output file. This option may be given more than once. Note that using this option inap- propriately may make the output file unusable. -s --strip-all Remove all symbols. -g -S -d --strip-debug Remove debugging symbols only. --strip-unneeded Remove all symbols that are not needed for relocation processing. -K symbolname --keep-symbol=symbolname Keep only symbol symbolname from the source file. This option may be given more than once. -N symbolname --strip-symbol=symbolname Remove symbol symbolname from the source file. This option may be given more than once, and may be combined with strip options other than -K. -o file Put the stripped output in file, rather than replacing the existing file. When this argument is used, only one objfile argument may be specified. -p --preserve-dates Preserve the access and modification dates of the file. -x --discard-all Remove non-global symbols. -X --discard-locals Remove compiler-generated local symbols. (These usually start with L or ..) -V --version Show the version number for strip. -v --verbose Verbose output: list all object files modified. In the case of archives, strip -v lists all members of the archive. SEE ALSO
the Info entries for binutils. COPYRIGHT
Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". binutils-2.13.90.0.18 2003-02-24 STRIP(1)
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy