Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Finding the next line when a pattern matches Post 302561427 by mr_manii on Tuesday 4th of October 2011 05:52:30 AM
Old 10-04-2011
Thanks a lot for the reply,problem solved
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding pattern & prepending a line with text

Hello Dudes, I have a task to make a unix shell script that should search for a specific TEXT in a file.If that TEXT is found, shell script should add a comment statement before that TEXT line. Ex : LINE 1 xxxxx LINE 2 xxxx CALL xxxx LINE 3 xxxx PERFORM UNTIL if i... (1 Reply)
Discussion started by: kirrushna
1 Replies

2. Shell Programming and Scripting

awk or sed for finding closest pattern to a line number

hi guys, I want to do pattern matching with awk or sed but I don't know how. here's what I want: I have a line number for a pattern that I have already found using grep, and I know a pattern like "---" that happens a few lines above that certain line number. I want to print out the chunk... (1 Reply)
Discussion started by: alirezan
1 Replies

3. Shell Programming and Scripting

Print line if first Field matches a pattern

Hi All, I would like my code to be able to print out the whole line if 1st field has a dot in the number. Sample input and expected output given below. My AWK code is below but it can;t work, can any expert help me ? Thanks in advance. {if ($1 ~ /*\.*/) { print $0 }} Input: ... (2 Replies)
Discussion started by: Raynon
2 Replies

4. Shell Programming and Scripting

Print word 1 in line 1 and word 2 in line 2 if it matches a pattern

i have a file in this pattern MATCH1 word1 IMAGE word3 word4 MATCH2 word1 word2 word3 word4 MATCH2 word1 word2 word3 word4 MATCH2 word1 word2 word3 word4 MATCH2 word1 word2 word3 word4 MATCH1 word1 IMAGE word3 word4 MATCH2 word1 word2 word3 word4 MATCH2 word1 word2 word3 word4 MATCH2 word1... (7 Replies)
Discussion started by: bangaram
7 Replies

5. Shell Programming and Scripting

Perl line count if it matches a pattern

#!/usr/bin/perl use Shell; open THEFILE, "C:\galileo_integration.txt" || die "Couldnt open the file!"; @wholeThing = <THEFILE>; close THEFILE; foreach $line (@wholeThing){ if ($line =~ m/\\0$/){ @nextThing = $line; if ($line =~ s/\\0/\\LATEST/g){ @otherThing =... (2 Replies)
Discussion started by: nmattam
2 Replies

6. Shell Programming and Scripting

Remove if the above line matches pattern

but keep if does not I have a file: --> my.out foo: bar foo: moo blarg i am on vacation foo: goose foo: lucy foo: moose foo: stucky groover@monkey.org foo: bozo grimace@gonzo.net dear sir - blargo blargo foo: goon foo: sloppy foo: saudi gimme gimme gimme (3 Replies)
Discussion started by: spacegoose
3 Replies

7. Shell Programming and Scripting

solved -gawk, search for pattern - mark the previous line as a variable?

Im trying to parse ifconfig with awk and setup a bunch of variables in one shot. But Im having trouble figuring out how to work with data in previous lines. ifconfig output: eth0 Link encap:Ethernet HWaddr 00:50:DA:10:7F:1B inet addr:10.10.10.10 Bcast:10.10.10.127 ... (0 Replies)
Discussion started by: trey85stang
0 Replies

8. Shell Programming and Scripting

Count number of pattern matches per line for all files in directory

I have a directory of files, each with a variable (though small) number of lines. I would like to go through each line in each file, and print the: -file name -line number -number of matches to the pattern /comp/ for each line. Two example files: cat... (4 Replies)
Discussion started by: pathunkathunk
4 Replies

9. Shell Programming and Scripting

Remove entire line from a file if 1st column matches a pattern

I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID Scenario is: delete all line if Employee Number (1st column) contains below 1. Non-numeric Employee Number 2. Employee Number that... (3 Replies)
Discussion started by: anshu ranjan
3 Replies

10. Shell Programming and Scripting

How to get a 1st line which matches the particular pattern?

Hi all, I have file on which I do grep on "/tmp/data" then I get 5 lines as dir Path: /tmp/data/20162343134 Starting to listen on ports logging: -- Moving results files from local storage: /tmp/resultsFiles/20162343134/*.gz to NFS: /data/temp/20162343134/outgoing from above got to get... (7 Replies)
Discussion started by: girijajoshi
7 Replies
Jifty::Action::Record::Execute(3pm)			User Contributed Perl Documentation		       Jifty::Action::Record::Execute(3pm)

NAME
Jifty::Action::Record::Execute - Simple abstract based for record actions SYNOPSIS
use strict; use warnings; package MyApp::Action::StartEncabulator; use base qw/ MyApp::Action::ExecuteEncabulator /; use Jifty::Param::Schema; use Jifty::Action schema { param cardinal_grammeter_mode => type is 'text', valid_values are qw/ magneto-reluctance capacitive-duractance sinusoidal-depleneration /, is mandatory, ; }; sub take_action { my $self = shift; my $mode = $self->argument_value('cardinal_grammeter_mode'); $self->record->start($mode); $self->result->success('Deluxe Encabulator has started!'); } # Later in your templates: my $encabulator = MyApp::Model::Encabulator->new; $encabulator->load($id); my $startup = Jifty->web->new_action( class => 'StartEncabulator', record => $encabulator, ); Jifty->web->form->start; Jifty->web->out( $startup->form_field('cardinal_grammeter_mode') ); Jifty->web->form->submit( label => _('Start'), submit => $startup, ); Jifty->web->form->end; DESCRIPTION
This action class is a good generic basis for creating custom action classes. It expects a record object to be associated and is (in this way) very similar to Jifty::Action::Record::Delete. You can use Jifty::Param::Schema to add additional form fields to the action and such. METHODS
arguments This is customized so that it expects the "record" argument of all Jifty::Action::Record actions, but also allows for overrides using Jifty::Param::Schema. take_action This overrides the definition in Jifty::Action::Record so that it does absolutely nothing rather than complain. You will probably want to implement your own version that actually does something. SEE ALSO
Jifty::Action, Jifty::Action::Record, Jifty::Record LICENSE
Jifty is Copyright 2005-2010 Best Practical Solutions, LLC. Jifty is distributed under the same terms as Perl itself. perl v5.14.2 2010-12-10 Jifty::Action::Record::Execute(3pm)
All times are GMT -4. The time now is 06:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy