substitude the pattern in vi
i just want to substitude the multiple pattenm, i mean two to three word simulteneously. i.e
linux==LINUX UNIX==unics kernel==core i need this replacement in vi editor . as we do :s/linux/LINUX/g this is for only one pattern .similarly i need all three in one.It's great if you put the knowdge in vi editor. |
Maybe you really want to use sed:
cat file1 | sed -e '1,$s/linux/LINUX/g' | \ sed -e '1,$s/kernel/core/g' >file2 vi is designed to give you quick visual feedback. If you want to do programmatic large scale substitutions, try sed, awk, or perl. |
yha , i need what u did here. but u had done in two substitution in the solution . but i need to do such many substitution in lot of time so it's not benificial for me .
e.g i want to convert some of character in the file from capital to small letter. so what method you had mention is not give the complete solution . |
I'll second Jerre. You might look into writing a short sed script that you can modify as needed.
grymoire.com has some excellent tutorials, including one on sed. |
it's really help full one
Quote:
thanks |
All times are GMT -5. The time now is 09:06 PM. |