Sponsored Content
Top Forums Shell Programming and Scripting Making Changes to large file in vi Post 302620291 by SkySmart on Saturday 7th of April 2012 09:13:27 PM
Old 04-07-2012
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

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed : Making changes in the same file

sed 's/abc/xyz/g' abc.txt > abc.txt This change all the abc s in abc.txt to xyz s but does not write back to the abc.txt. Suggest me the cleaner way without using temp file please. Cheers, Amol. (3 Replies)
Discussion started by: amol
3 Replies

2. Shell Programming and Scripting

Making Changes without opening file

Hello, I'm new to scripting, I have a file test.dat. I want to make changes to it with out openning it. Example: test.dat has rows, and I want to change value "LA" to "TX" without opening it or without writing it to another file. Is it possible? Thanks (9 Replies)
Discussion started by: irehman
9 Replies

3. Shell Programming and Scripting

making the changes permanent in a file

Hi Friends. I have a file called install.data which has fields like : XXXXX ACVCGFFTFY UAHIUH OI CONNECTION=tape/11/ LOCATAION=08-90-89 SIZE=90 I had to change the values of some of these variables. So i did : grep "SIZE" instal.data | sed 's/*/00/' ...this is working fine on command... (4 Replies)
Discussion started by: vijaya2006
4 Replies

4. SCO

making an iso file...

can i make an iso file from my DAT tape? pref .ISO? the thing is .. i have an 5.0.7 and a complete backup of hd (cpio cmd) on to tape (find . -depth -print | cpio -oVcB -C 20480 -O /dev/rStp0) that i made after booting from boot&root floppies now i want to take this backup and dump it on... (5 Replies)
Discussion started by: asafronit
5 Replies

5. UNIX for Dummies Questions & Answers

problem while making ftp of a large file

Hi Friends, I'mfacing a problem while doing ftp of a large file.The control session is getting closed after sometime.But data session transfers the file successfully even when the control seeion is lost.I need to make the control session available as long as data session is active. How can i... (1 Reply)
Discussion started by: rprajendran
1 Replies

6. AIX

Making Executable File

Hi All: I am a newbie. I have shell script and bunch of java jar files and I want to give one single executable file (may be .bin). Ex: I have test.sh, jar1.jar, jar2.jar. I have to make process.xxx When we run "process.xxx" it will run the "test.sh" script which inturn uses jar1.jar and... (0 Replies)
Discussion started by: laxman123
0 Replies

7. Shell Programming and Scripting

Making Large Connection nodes for Graph

Hi power user, Basically, this thread is a continuation of the previous one :): https://www.unix.com/shell-programming-scripting/110650-making-connection-nodes-graph.html#post302326483 However, I'm going to explain it again. I have this following data: file1 aa A ... (3 Replies)
Discussion started by: anjas
3 Replies

8. Programming

Making hard link to a file in C

hi there guys could someone please, show me how to make a hard link to a file in c language ? i am using minix. The program below reads the last number from file numbers, adds a one to it and then appends the new number into the file. I use a c script as driver to this program, the c script... (1 Reply)
Discussion started by: surubi_abada
1 Replies

9. UNIX for Dummies Questions & Answers

Making file executable

Hi guys, i'm trying to make a file called 'run-all-tests' executable but it is not letting me for some reason. I am presented with the following error: chmod: cannot access `./run-tests': No such file or directory Basically i have a folder called ex3 and within that there are task folders:... (11 Replies)
Discussion started by: Shyamz1
11 Replies

10. UNIX for Dummies Questions & Answers

Making replicates of a file with part of a line randomized for each file

Ok, so let's say that I have a file like the following: I want to create 100 replicates of this file, except that for each file, I want different randomized combinations of either A or B at the end of each line so that I would end up with files like the following: and etc. I... (1 Reply)
Discussion started by: Scatterbrain26
1 Replies
cowbuilder(8)							     cowdancer							     cowbuilder(8)

NAME
       cowbuilder - a pbuilder wrapper for cowdancer.

SYNOPSIS
       cowbuilder [commands] [options]

DESCRIPTION
       cowbuilder Executes the specified pbuilder operation with cowdancer

COMMANDS
       Most commands invoke pbuilder with the specified commands, see pbuilder manual for details.

       --create

	      Create the base.cow image.  The directory for base.cow should be empty, or this command will fail.

       --update

	      Update the base.cow image.

       --build .dsc-file

	      Build a package given a .dsc file

       --login

	      Start a session within the base.cow.

       --execute

	      Execute a command within the base.cow.

       --dumpconfig

	      dump configuration information.

OPTIONS
       Most options are the same as pbuilder, except for the following which are handled specially

       --buildplace

	      The place where COW operation takes place.

       --basepath
	      has a very different meaning to basetgz option of pbuilder, since there is no tgz.  This option specifies the directory in which the
	      COW master data is stored, the default being /var/cache/pbuilder/base.cow

       --configfile [configuration file to load]
	      Additional configuration file to read after all other configuration files have been read.

       --no-cowdancer-update

	      Do not use cowdancer on cowbuilder --update. Please use this option when cowdancer is interfering with upgrade process, or cowdancer
	      itself is being upgraded within chroot.

       --debian-etch-workaround

	      Work around on Debian etch compatibility. cow-shell will search for all files in chroot, but will work.

CONFIGURATION FILES
       cowbuilder reads the following configuration files per default.

       /usr/share/pbuilder/pbuilderrc
	      Application default, not to be changed.

       /etc/pbuilderrc
	      System-wide default.

       ~/.pbuilderrc
	      User default

       anything specified with --configfile option
	      Additional configuration at runtime.

CONFIGURATION FILE OPTIONS
       The possible configuration options are as follows.  Others are ignored.

       DISTRIBUTION=distribution

       BUILDRESULT=directory

       BUILDPLACE=directory

       BASEPATH=path

       MIRRORSITE=http://mirror

       NO_COWDANCER_UPDATE=1

	      See --no-cowdancer-update

       DEBIAN_ETCH_WORKAROUND=1

	      See --debian-etch-workaround

EXAMPLES
       cowbuilder --create
	      Create a base.cow image.

	      # cowbuilder --create --hookdir /usr/share/doc/pbuilder/examples/workaround/ --distribution etch --debootstrap debootstrap --basepath /var/cache/pbuilder/base-test.cow
	      bash: /root/.pbuilderrc: No such file or directory
	      W: /home/dancer/.pbuilderrc does not exist
	       -> Running in no-targz mode
	      Distribution is etch.
	      Building the build environment
	       -> running debootstrap
	      /usr/sbin/debootstrap
	      I: Retrieving Release
		   .
		   .

       cowbuilder --update
	      Update the base.cow image.

	      # cowbuilder --update
	      bash: /root/.pbuilderrc: No such file or directory
	       -> Copying COW directory
	       -> Invoking pbuilder
	      W: /home/dancer/.pbuilderrc does not exist
	       -> Running in no-targz mode
	       -> copying local configuration
	       -> mounting /proc filesystem
	       -> mounting /dev/pts filesystem
	       -> policy-rc.d already exists
	      Refreshing the base.tgz
	       -> upgrading packages
		   .
		   .

       cowbuilder --build test_0.1.dsc
	      Build the package specified in dsc file, with the base.cow image.

       pdebuild --pbuilder cowbuilder
	      Run
	      cowbuilder --build
	      against the current directory.
	      The current directory should be an extracted Debian source package directory.

	      Edit
	      /etc/pbuilderrc
	      to have
	      PDEBUILD_PBUILDER=cowbuilder
	      to make this the default behavior for
	      pdebuild.

       cowbuilder --login --bindmounts /home/dancer
	      Start a cow-shell session inside base.cow, with
	      /home/dancer
	       being bind-mounted to within chroot.

	      Note that cowbuilder will not cow-protect what is inside
	      /home/

	      # cowbuilder --login --bindmount ${HOME}
	      bash: /root/.pbuilderrc: No such file or directory
	       -> Copying COW directory
	       -> Invoking pbuilder
	      W: /home/dancer/.pbuilderrc does not exist
	       -> Running in no-targz mode
	       -> copying local configuration
	       -> mounting /proc filesystem
	       -> mounting /dev/pts filesystem
	      -> Mounting /home/dancer
	       -> policy-rc.d already exists
	       -> entering the shell
	      #

       cowbuilder --create --distribution sid --basepath /var/cache/pbuilder/base-test.cow
	      Create a base.cow image with the path
	      /var/cache/pbuilder/base-test.cow
	      and distribution sid.

AUTHOR
       Junichi Uekawa (dancer@debian.org)

SEE ALSO
       /usr/share/doc/pbuilder/pbuilder-doc.html, pbuilder (8), pdebuild (1)

cowdancer							    2007 Jun 17 						     cowbuilder(8)
All times are GMT -4. The time now is 09:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy