09-29-2010
Print lines between two lines after grep for a text string
Franklin, Thank you for the time you have taken to answer my query. The latest code works and produces the output that I wanted, however it will stop at the first occurrence of the <pattern>. In the file I am using for my test there are 19 of the key words.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I need help in following scenario. I have a file with about 10,000 lines. There are several lines which have word "START" (all upper case) in them. I want to grep line with word "START" and then do the following
1. Print the line number having word "START"
2. Print the next 11 lines.
... (4 Replies)
Discussion started by: jakSun8
4 Replies
2. Shell Programming and Scripting
frnd,
Is there any way to print only the string that matched the pattern instead printing the whole line?
thanks in advance. (3 Replies)
Discussion started by: clx
3 Replies
3. Shell Programming and Scripting
Hi folks
I am not allowed to install GNU grep on AIX.
Here my code excerpt:
grep_fatal () {
/usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP"
}
Howto the same on AIX based machine?
from manual GNU grep
‘--after-context=num’
Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies
4. Shell Programming and Scripting
hello,
I go text file like this
E:/DDD/Dyndede/wwww
E:/DDD/sss.com/ffffg/fff
E:/DDD/vvvvvv/dd
E:/DDD/sss.com/bbbbbb
E:/DDD/sss.com/nnnn/xxI want to print
/alpha.jpg at the end of every lines like that
E:/DDD/Dyndede/wwww/alpha.jpg
E:/DDD/sss.com/ffffg/fff/alpha.jpg... (8 Replies)
Discussion started by: davidkhan
8 Replies
5. Shell Programming and Scripting
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)
Discussion started by: kmkocot
1 Replies
6. Shell Programming and Scripting
Hi
I have this in my file
2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times.
2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times.
2011-04-18 15:32:11... (9 Replies)
Discussion started by: zorrox
9 Replies
7. Shell Programming and Scripting
Hello,
I want to extract from a file like :
20120530025502914 | REQUEST | whatever
20120530025502968 | RESPONSE | whatever
20120530025502985 | RESPONSE | whatever
20120530025502996 | REQUEST | whatever
20120530025503013 | REQUEST | whatever
20120530025503045 | RESPONSE | whatever
I want... (14 Replies)
Discussion started by: black_fender
14 Replies
8. Shell Programming and Scripting
RHEL 5.8
I have a text file like below. I want to grep for a string and then print the next 4 lines including the line with the string I grepped for
For eg:
I want grep for the string HANS and then print the next 4 lines including HANS
$ cat someText.txt
JOHN
NATIONALITY:... (7 Replies)
Discussion started by: omega3
7 Replies
9. Shell Programming and Scripting
say we have :
2914 | REQUEST | whatever
2914 | RESPONSE | whatever
2914 | SUCCESS | whatever
2985 | RESPONSE | whatever
2986 | REQUEST | whatever
2990 | REQUEST | whatever
2985 | RESPONSE | whatever
2996 | REQUEST | whatever
2010 | SUCCESS | whatever
2013 | REQUEST | whatever
2013 |... (7 Replies)
Discussion started by: Saumitra Pandey
7 Replies
LEARN ABOUT DEBIAN
apertium-lextor
apertium-lextor(1) apertium-lextor(1)
NAME
apertium-lextor - This application is part of ( apertium )
This tool is part of the apertium machine translation architecture: http://apertium.org.
SYNOPSIS
apertium-lextor --trainwrd stopwords words n left right corpus model [ --weightexp w ] [ --debug ]
apertium-lextor --trainlch stopwords lexchoices n left right corpus wordmodel dic bildic model [ --weightexp w ] [ --debug ]
apertium-lextor --lextor model dic left right [ --debug ] [ --weightexp w ]
DESCRIPTION
apertium-lextor is the application responsible for training and usage of the lexical selector module.
OPTIONS
--trainwrd | -t
Train word co-occurrences model. It needs the following required parameters:
stopwords file containing a list of stop words. Stop words are ignored.
words file containing a list of words. For each word a co-occurrence model is built.
n number of words per co-occurrence model (for each model, the n most frequent words).
left left-side context to take into account (number of words).
right right-side context to take into account (number of words).
corpus file containing the training corpus.
model output file on which the co-occurrence models are saved.
--trainlch | -r
Train lexical choices co-occurrence models using a target language co-occurrence model and a bilingual dictionary. It needs the following
required parameters:
stopwords file containing a list of stop words. Stop words are ignored.
lexchoices file containing a list of lexical choices. For each lexical choice a co-occurrence model is built.
n number of words per co-occurrence model (for each model, the n most frequent words).
left left-side context to take into account (number of words).
right right-side context to take into account (number of words).
corpus file containing the training corpus.
wordmodel target-language word co-occurrence model (previously trained by means of the --trainwrd option).
dic the lexical-selection dictionary (binary format).
bildic the bilingual dictionary (binary format).
model output file on which the co-occurrence models are saved.
--lextor | -l
Perform the lexical selection on the input stream. It needs the following required parameters:
model file containing the model to be used for the lexical selection.
dic lexical-selection dictionary (binary format).
left left-side context to take into account (number of words).
right right-side context to take into account (number of words).
--weightexp w
Specify a weight value to change the influence of surrounding words while training or performing the lexical selection. The parameter w
must be a positive value.
--debug | -d
Show debug information while working.
--help | -h
Shows this help.
--version | -v
Shows license information.
SEE ALSO
apertium-gen-lextorbil(1), apertium-preprocess-corpus-lextor(1), apertium-gen-stopwords-lextor(1), apertium-gen-wlist-lextor(1), aper-
tium-gen-wlist-lextor-translation(1), apertium-lextor-eval(1), apertium-lextor-mono(1).
BUGS
Lots of...lurking in the dark and waiting for you!
AUTHOR
(c) 2005,2006 Universitat d'Alacant / Universidad de Alicante. All rights reserved.
2006-12-12 apertium-lextor(1)