Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-15-2011, 12:50 AM   #16
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56

Hey, I know it has been solved, but I thought I would join the crowd. It can be done in the vi editor fairly easily.

Old 02-15-2011, 01:03 AM   #17
Senior Member
Registered: Dec 2004
Posts: 1,055

Original Poster
Rep: Reputation: 78
Originally Posted by wmakowski View Post
Hey, I know it has been solved, but I thought I would join the crowd. It can be done in the vi editor fairly easily.

Thanks for the input. Questions:
1) is your solution case sensitive? Does vi accept an "i" flag?
2) Would it also replace "d1 com" with (note the space). Is there any way to escape the period so that it must be and not d1xcom or d1_com?
3) Does vi bog down when you open the file? I've been able to do some of this stuff in nano but it takes a good long time to open large files sometime and do all the replacements. This db dump is 150MB.
Old 02-15-2011, 01:30 AM   #18
Senior Member
Registered: Oct 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Your right %s/ is matching things like d12com d1_com. You will need to escape the periods.
I think /i works just as well. "bog down" depends on your system Give it a try but I think sed or perl is a better bet.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux command to find and replace string within text file chips11 Linux - Newbie 5 11-24-2008 03:25 PM
Find and replace text in multiple file Bad_Bob Linux - Software 9 05-08-2008 03:31 AM
Need command to search and replace text in file acascianelli AIX 12 04-11-2007 09:16 PM
command line edit -- global find/replace on text file w/o going into vi car182 Linux - Newbie 4 05-25-2006 06:42 PM
help! Script or command needed to replace text in a file. farmerjoe Linux - Newbie 2 01-02-2005 04:07 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:44 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration