![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| find and replace | javeed7 | Shell Programming and Scripting | 1 | 04-02-2008 06:00 AM |
| find and replace | rakshit | Shell Programming and Scripting | 4 | 01-23-2008 11:52 PM |
| find and replace | mahabunta | UNIX for Dummies Questions & Answers | 7 | 09-21-2006 09:05 AM |
| find and replace | vikas_j@hotmail | UNIX for Dummies Questions & Answers | 3 | 02-25-2002 01:41 PM |
| Find & Replace | gagansharma | Shell Programming and Scripting | 3 | 11-27-2001 12:17 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
find and replace
I have a file that I want to remove all of the periods from. I am using the below to remove quotations and it works fine -I thought I could make it work for the period but it does not. Any help would be appreciated.
works to remove the double quote mark (") sed -e 's/"//g' input file >output file tried sed -e 's/.//g' input file >output file and sed -e 's/"."//g' input file >output file valhutch |
| Forum Sponsor | ||
|
|
|
|||
|
sed - edit files in place
Some versions of 'sed' support in-place editing using the '-i' option, while others do not.
An alternative is using perl from the command line ( assuming it's installed ), and using the '-i -pe' options. '-i' edits files in place. '-e' allows you to define Perl code to be executed '-p' loops around every line in the file and performs the substitution This will remove all period characters from the file "input_file". Code:
perl -i -pe 's/[.]//g' input_file Code:
sed -e 's/\.//g' |