Sponsored Content
Top Forums Shell Programming and Scripting How to delete last occurence of word using Linux command? Post 302772216 by nsk on Sunday 24th of February 2013 12:59:22 PM
Old 02-24-2013
Thanks for your quick reply RudiC.But this command is removing all "and"s from each line.
I am getting out put like this.
on a.id1 = b.id1
on a.id2 = b.id2
on a.id3 = b.id3

Thanks
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count the number of occurence of perticular word from file

I want to count the number of occurence of perticular word from one text file. Please tell me "less" command is work in ksh or not. If it is not working then instead of that which command will work. :confused: (40 Replies)
Discussion started by: rinku
40 Replies

2. Shell Programming and Scripting

Delete all occurence of a word in one shot

i have a file called file1 cat file1 i am namish namish lives in India India and namish both are good. I want to delete all the occurences of namish in one shot,if i do it with sed i guess all the lines will be deleted containing the pattern.Suggest me any idea without AWK. Thanks... (6 Replies)
Discussion started by: namishtiwari
6 Replies

3. UNIX for Dummies Questions & Answers

search& count for the occurence of a word

Greetings, I need to search and count all the occurences of a word in all the files in a directory. Any suggestions greatly appreciated. Thanks (1 Reply)
Discussion started by: skoppana
1 Replies

4. Shell Programming and Scripting

finding the number of occurence of a word in a line

suppose i have this line abs|der|gt|dftnrk|dtre i want to count the number of "|" in this line.. how can i do that. plz help:confused: (9 Replies)
Discussion started by: priyanka3006
9 Replies

5. UNIX for Dummies Questions & Answers

counting the occurence of a word

In a file I have to count a particular word. like i need apache how many times. I tried this $ tr "\011" "\012\012"<foo1 | tr -cd "" |sort\uniq -c but I got result like this 32 apache 18 dns 12 doctor Please sugest me (4 Replies)
Discussion started by: pranabrana
4 Replies

6. Shell Programming and Scripting

Perl : Search for next occurence of a word in an array

I have an array as follows: Space: ABC Name: def Age: 22 Type: new Name: fgh Age: 34 Type: old Space: XYZ Name: pqr Age: 44 Type: new : : How can I separate the array with elements starting from Space:ABC until Space: XYZ & put them in a different array & so on... (4 Replies)
Discussion started by: deo_kaustubh
4 Replies

7. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurence of a specific word

Hello, I have several files in a specific directory. A specific string in one file can occur in another files. If this string is in other files. Then all the files in which this string occured should be deleted and only 1 file should remain with the string. Example. file1 ShortName "Blue... (2 Replies)
Discussion started by: premier_de
2 Replies

8. Shell Programming and Scripting

How to find the number of occurence of particular word from a text file?

example: i have the following text file... i am very tired. i am busy i am hungry i have to find the number of occurence of a particular word 'am' from the text file.. can any one give the shell script for it (34 Replies)
Discussion started by: sheela
34 Replies

9. Shell Programming and Scripting

Command to delete a word in all files

can anyone tell me what is the commands to delete the below particular word in the all files located in one particular file path files/ll>grep "/ftp/" test.kell ftp -m uskmc -d /ftp/ -i filename.zip output should be : ftp -m uskmc -d -i filename.zip (4 Replies)
Discussion started by: ramkumar15
4 Replies
VCS::Lite::Delta(3pm)					User Contributed Perl Documentation				     VCS::Lite::Delta(3pm)

NAME
VCS::Lite::Delta - VCS::Lite differences SYNOPSIS
use VCS::Lite; # diff my $lit = VCS::Lite->new('/home/me/foo1.txt'); my $lit2 = VCS::Lite->new('/home/me/foo2.txt'); my $difftxt = $lit->delta($lit2)->diff; print OUTFILE $difftxt; # patch my $delt = VCS::Lite::Delta->new('/home/me/patch.diff'); my $lit3 = $lit->patch($delt); print OUTFILE $lit3->text; DESCRIPTION
This module provides a Delta class for the differencing functionality of VCS::Lite API
new The underlying object of VCS::Lite::Delta is an array of difference chunks (hunks) such as that returned by Algorithm::Diff. The constructor takes the following forms: my $delt = VCS::Lite::Delta->new( '/my/file.diff',$sep); # File name my $delt = VCS::Lite::Delta->new( *FILE,$sep); # File handle my $delt = VCS::Lite::Delta->new( $string,$sep); # String as scalar ref my $delt = VCS::Lite::Delta->new( @foo, $id1, $id2) # Array ref $sep here is a regexp by which to split strings into tokens. The default is to use the natural perl mechanism of $/ (which is emulated when not reading from a file). The arrayref form is assuming an array of hunks such as the output from Algorithm::Diff::diff. The other forms assume the input is the text form of a diff listing, either in diff format, or in unified format. The input is parsed, and errors are reported. diff print OUTFILE $delt->diff This generates a standard diff format, for example: 4c4 < Now wherefore stopp'st thou me? --- > Now wherefore stoppest thou me? udiff print OUTFILE $delt->udiff This generates a unified diff (like diff -u) similar to the form in which patches are submitted. id my ($id1,$id2) = $delt->id; $delt2->id('foo.pl@@1','foo.pl@@3') The id method allows get and set of the names associated with the two elements being diffed. The id is set for delta objects returned by VCS::Lite->diff, to the element IDs of the VCS::Lite objects being diffed. Diff format omits the file names, hence the IDs will not be populated by new. This is not the case with diff -u format, which includes the file names which are passed in and available as IDs. hunks my @hunklist = $delt->hunks A hunk is a technical term for a section of input containing a difference. Each hunk is an arrayref, containing the block of lines. Each line is itself an arrayref, for example: [ [ '+', 9, 'use Acme::Foo;'], [ '-', 9, 'use Acme::Bar;'], ] See the documentation on Algorithm::Diff for more details of this structure. BUGS, PATCHES &; FIXES There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please send an email to barbie@cpan.org or submit a bug to the RT system (see link below). However, it would help greatly if you are able to pinpoint problems or even supply a patch. http://rt.cpan.org/Public/Dist/Display.html?Name=VCS-Lite Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me. AUTHOR
Original Author: Ivor Williams (RIP) 2008-2009 Current Maintainer: Barbie <barbie@cpan.org> 2009 COPYRIGHT
Copyright (c) Ivor Williams, 2002-2006 Copyright (c) Barbie, 2009 LICENCE
You may use, modify and distribute this module under the same terms as Perl itself. SEE ALSO
Algorithm::Diff. perl v5.10.1 2009-10-25 VCS::Lite::Delta(3pm)
All times are GMT -4. The time now is 05:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy