Substitute a string :)
Good morning gentlemen /... i have some text files and i want to open them and substitute a specific string with one another.... What should i do?
Thx a lot |
This will find and replace all instances of 'LQ' with 'Linux Questions' in all .txt files in the current directory.
Code:
for i in `ls *.txt`; do |
With recently sed, you could try:
Code:
for file in `ls *.txt`; do |
Or direct in vi:
1. open the file with vi ( #vi file-name ) 2. Go to "Last Line Mode" (press : ) 3. %s/string_to_replace/string_to_replace_with/g |
All times are GMT -5. The time now is 12:59 PM. |