Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How would you replace the n character in a file with some
xyz?

Answers were Sorted based on User's Feedback



How would you replace the n character in a file with some xyz?..

Answer / ram

* sed 's/n/xyz/g' filename > new_filename
s -search and replace
n -character to be replaced
xyz - character to replace
g -global

* vi filename
:%s/n/xyz/g --search and replace
:w! ---save

Is This Answer Correct ?    8 Yes 0 No

How would you replace the n character in a file with some xyz?..

Answer / vipul dalwala

sed -i 's/n/xyz/g' filename

Is This Answer Correct ?    3 Yes 0 No

How would you replace the n character in a file with some xyz?..

Answer / viswa

In Vi editor,:%s/n/xyz/g

Is This Answer Correct ?    2 Yes 0 No

How would you replace the n character in a file with some xyz?..

Answer / sasmita

:1,$ s/n/xyz/g

Is This Answer Correct ?    1 Yes 0 No

How would you replace the n character in a file with some xyz?..

Answer / seshadri sethi

sed ’s/n/xyz/g’ filename > new_filename



We can replace n characters by using the following command:
1,$s/./xyz/g
where 1 shows that the search string will start searching
patterns from first line of the file.
ā€˜.’ for any character.
g for global replacemet.

Is This Answer Correct ?    1 Yes 0 No

How would you replace the n character in a file with some xyz?..

Answer / suresh raju

sed 's/.\{1,75\}/xyz/g' filename

here n=75. so 75 characters will be replaced with xyz

Is This Answer Correct ?    1 Yes 0 No

How would you replace the n character in a file with some xyz?..

Answer / tony

cat filename | sed 's/n/xyz/g' > newfile

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

What language is bash written in?

0 Answers  


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

0 Answers   Tech Mahindra,


What are script files?

0 Answers  


What does chmod do?

0 Answers  


What is the difference between scripting and coding?

0 Answers  


What is the difference between a variable and value?

7 Answers   Sun Microsystems,


What is the use of "shift" command in passing parameters?

1 Answers  


How do I open a jshell in cmd?

0 Answers  


How to group the commands in shell scripting?

2 Answers   Polaris,


How do I debug a shell script?

0 Answers  


How do I set bash as default shell mac?

0 Answers  


What is the use of "$?" Sign in shell script?

0 Answers  


Categories