|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Making Changes to large file in vi
so i have a large file that has many lines in it. i want to make changes (replace certain things) that are in a range of lines, but NOT the whole file. how do i do this? say for instance, if i want to change all the occurrences of the word "ramamama" to "ram cow welcome" in lines 9333 to 35000. How do i do this? below is as far as i've gotten: Code:
:%s~ramamama~ram cow welcome~g |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Code:
:9333,35000s/ramamama/ram cow welcome/g |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
can the slashes be avoided? |
|
#4
|
|||
|
|||
|
If you're using vim you can replace the slashes with another character. I'm not sure in other versions of vi though.
|
| The Following User Says Thank You to keb0x80 For This Useful Post: | ||
SkySmart (04-07-2012) | ||
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
i just tested it. unfortunately, it appears it isn't working. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Please post what Operating System and version you are running and what Shell you are using.
Please post quantative figures for your file. Exact size? Number of records? Largest record size? And for your computer: How much memory do you have fitted? Quote:
Does the command work WITH the solidii? |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Making replicates of a file with part of a line randomized for each file | Scatterbrain26 | UNIX for Dummies Questions & Answers | 1 | 08-10-2011 05:55 PM |
| Making Large Connection nodes for Graph | anjas | Shell Programming and Scripting | 3 | 07-13-2009 05:20 AM |
| problem while making ftp of a large file | rprajendran | UNIX for Dummies Questions & Answers | 1 | 05-28-2008 01:19 AM |
| making an iso file... | asafronit | SCO | 5 | 03-08-2008 05:18 PM |
| sed : Making changes in the same file | amol | Shell Programming and Scripting | 3 | 07-17-2002 06:50 AM |
|
|