Hi,
I want to print only lines in between two strings and not the strings using awk.
Eg:
OUTPUT
top 2
bottom 1
left 0
right 0
page 66
END
I want to print into a new file only
top 2
bottom 1
left 0... (4 Replies)
Hi experts,
You cool guys already given me the awk script below-
awk '/9366109380/,printed==5 { ++printed; print; }' 2008-09-14.0.log
Morever, i have one more things-
when i awk 9366109380, i can also see the Upper 3 lines as well as below 5 lines of that string.
Line 1.... (3 Replies)
Hi,
Please provide shell script to Remove empty lines(space) between two lines containing strings in a file.
Input File :
A1/EXT "BAP_BSC6/07B/00" 844 090602 1605
RXOCF-465 PDTR11 1
SITE ON BATTERY
A2/EXT... (3 Replies)
pls help me on this... and im really sorry because i really don't know where to start here...
FILE1
ABC DEF 10 2
DEF GHI 11 3
GHI JKL 12 5
JKL MNO 13 7
MNO PQR 14 5
requirements:
1. The third string should only be 10 or 12
2. The fourth string should only be 2 or 3
3. Prinnt... (1 Reply)
Hi all,
This should be very easy but I can't figure it out...
I have a file that looks like this:
@SRR057408.1 FW8Y5CK02R652T length=34
AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT
+SRR057408.1 FW8Y5CK02R652T length=34
FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8
@SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Hi,
I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines).
#################################
huge_file.txt
a
a
ab
b
##################################
small_file.txt
a 1.5
b 2.5
ab ... (4 Replies)
The question is not as simple as the title... I have a file, it looks like this
<string name="string1">RZ-LED</string>
<string name="string2">2.0</string>
<string name="string2">Version 2.0</string>
<string name="string3">BP</string>
I would like to check for duplicate entries of... (11 Replies)
Hello,
I can extract lines in a file, between two strings but only one time.
If there are multiple occurencies, my command show only one block.
Example, monfichier.txt contains :
debut_sect
texte L1
texte L2
texte L3
texte L4
fin_sect
donnees inutiles 1
donnees inutiles 2
... (8 Replies)
Hello everyone,
Maybe somebody could help me with an awk script.
I have this input (field separator is comma ","):
547894982,M|N|J,U|Q|P,98,101,0,1,1
234900027,M|N|J,U|Q|P,98,101,0,1,1
234900023,M|N|J,U|Q|P,98,54,3,1,1
234900028,M|H|J,S|Q|P,98,101,0,1,1
234900030,M|N|J,U|F|P,98,101,0,1,1... (2 Replies)
I have a text file contains
*02638650* SAMBO
1 Spouse SAMBO FELIX
*01591453* MADUAGUGBUO
4 Child3 MADUAGUGBUO JOY
*01488523* ANYIAM
1 Spouse ANYIAM FRANCA
2 Child1 ANYIAM GRACE
*01647769* EGWUTUOHA
0 Principal ... (6 Replies)
Discussion started by: ktsis
6 Replies
LEARN ABOUT DEBIAN
test::bdd::cucumber::manual::steps
Test::BDD::Cucumber::Manual::Steps(3pm) User Contributed Perl Documentation Test::BDD::Cucumber::Manual::Steps(3pm)NAME
Test::BDD::Cucumber::Manual::Steps - How to write Step Definitions
VERSION
version 0.11
INTRODUCTION
The 'code' part of a Cucumber test-suite are the Step Definition files which match steps, and execute code based on them. This document
aims to give you a quick overview of those.
STARTING OFF
Most of your step files will want to start something like:
#!perl
use strict;
use warnings;
use Test::More;
use Test::BDD::Cucumber::StepFile;
use Method::Signatures;
The fake shebang line gives some hints to syntax highlighters, and "use strict;" and "use warnings;" are hopefully fairly standard at this
point.
Most of my Step Definition files make use of Test::More, but you can use any Test::Builder based testing module. Your step will pass its
pass or fail status back to its harness via Test::Builder - each step is run as if it were its own tiny test file, with its own localized
Test::Builder object.
Test::BDD::Cucumber::StepFile gives us the functions "Given()", "When()", "Then()" and "Step()". These pass the step definitions to the
class loading the step definitions, and specify which Step Verb should be used - "Step()" matches any.
Method::Signatures allows us to use a small amount of syntactic sugar for the step definitions, and gives us the "func()" keyword you'll
see in a minute.
STEP DEFINITIONS
Given qr/I have (d+)/, func ($c) {
$c->stash->{'scenario'}->{'count'} += $1;
}
When "The count is an integer", func ($c) {
$c->stash->{'scenario'}->{'count'} =
int( $c->stash->{'scenario'}->{'count'} );
}
Then qr/The count should be (d+)/, func ($c) {
is( $c->stash->{'scenario'}->{'count'}, $c->matches->[0], "Count matches" );
}
Each of the exported verb functions accept a regular expression (or a string that's used as one), and a coderef. The coderef is passed a
single argument, the Test::BDD::Cucumber::StepContext object. To make this a little prettier, we use Method::Signatures's "func()" keyword
so we're not continually typing: "sub { my $c = shift; ... ".
We will evaluate the regex immediately before we execute the coderef, so you can use $1, $2, $etc, although these are also available via
the StepContext.
NEXT STEPS
How step files are loaded is discussed in Test::BDD::Cucumber::Manual::Architecture, but isn't of much interest. Of far more interest
should be seeing what you have available in Test::BDD::Cucumber::StepContext...
AUTHOR
Peter Sergeant "pete@clueball.com"
LICENSE
Copyright 2011, Peter Sergeant; Licensed under the same terms as Perl
perl v5.14.2 2012-05-20 Test::BDD::Cucumber::Manual::Steps(3pm)