|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
sed command
Hi, I need to use appropriate sed command to replace all the
string "male" to "female" in file: myfile. I'm a Unix beginner and confused. Thanks. ![]() |
|
#2
|
|||
|
|||
|
Quote:
Try this: sed 's/male/female/g' <input_file >output_file This script will change all occurences of "male". If you leave out the "g" it will change the first occurence of "male" only. Read some tutorial. Regards ![]() |
|
#3
|
|||
|
|||
|
this also would change
xxmalezz to xxfemalezz do you want that ? using sed and little more precision s/\<male\>/fe&/g (could also be case sensitive )btw sed ... < input > output and sed ... input > output are the same NOT REALLY SURE /\<male\>/s//fe&/g COULD BE FASTER, not tested !
__________________
working on Solaris[5-9], preferred languages french and C. Last edited by guggach : February 11th, 2005 at 05:39 AM. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > sed command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|