how to subsitute


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to subsitute
# 1  
Old 06-24-2008
how to subsitute

hi to
all

i need to subsitute to_date('','MM/DD/yyyy')
this with narayana

sed 's/to_date('','MM/DD/yyyy')/narayana/g' file
# 2  
Old 06-24-2008
Try:

Code:
$ sed "s-to_date('','MM/DD/yyyy')-narayana-g" nr.txt

//Jadu
# 3  
Old 06-24-2008
thanks

i didn't understood the code

can u explain in detail

thanks
# 4  
Old 06-24-2008
Instead of / as delimiter I am using - and instead of ' , using " for the sed replacement.

//Jadu
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Subsitute string in file 1 by line n of file 2

Hello, My OS is Windows 10 and I am using Cygwin. The content of file 1 is: XXX string1 The content of file 2 is 4.156 2.312 3.527 1.687 etc.... I need to replace string 1 in file 1 by the content of line n in file 2. So the expected output is e.g.: XXX 3.527 (for n = 3) I... (14 Replies)
Discussion started by: supernono06
14 Replies

2. UNIX for Dummies Questions & Answers

help with subsitute

hi Is there any subsitute of expect module in solaris/linux. (0 Replies)
Discussion started by: esumiba
0 Replies

3. Shell Programming and Scripting

Subsitute from a position till end of line.

Hi, Having a following file's content, lets say: ABC|ANA|LDJ|||||DKD|||||| AJJ|KKDD||KKDK|||||||||||| KKD||KD|||LLLD||||LLD||||| Problem: Need to replace pipes from 8th occurrence of pipe till end. so the result should be: ABC|ANA|LDJ|||||DKD AJJ|KKDD||KKDK|||| ------- ------- ... (12 Replies)
Discussion started by: _Noprofi
12 Replies
Login or Register to Ask a Question