![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to replace specific text line out of multiple occurance | madhusmita | Shell Programming and Scripting | 5 | 06-17-2008 01:03 PM |
| How to search and replace text in same file | Vrgurav | Shell Programming and Scripting | 1 | 04-25-2008 06:20 AM |
| read space filled file and replace text at specific position | COD | Shell Programming and Scripting | 6 | 04-21-2008 05:40 AM |
| automating file search and replace text | ommatidia | Shell Programming and Scripting | 3 | 02-28-2008 04:40 PM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 10:24 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
overwriting a line in text file
I have a text file with following content (3 lines)
filename : output.txt first line:12/12/2008 second line:12/12/2008 third line:Y I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before. I tried using cat output.txt |sed -e 's/third line:Y/third line:Y/' , but in this case it writes the output to some other file and we have to replace that old file with new file. Do we have a way to do this without replacing the old file with new file after using sed command or can we do this any command other than sed? Last edited by santosham; 06-24-2008 at 11:16 AM.. |