Sponsored Content
Top Forums Shell Programming and Scripting How reverse cut or read rows of lines Post 302127636 by divz on Thursday 19th of July 2007 12:45:27 AM
Old 07-19-2007
Smilie Thanks a lot for the explaination....
This is really good work.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to read a file in reverse

I have to extract data from a text file which is huge in size >>10GB. ie between two strings. If I do an ordinary sed it takes forever to come out. I was wondering if there was anyway to do the entire process in reverse and on finding the relevant string is there any way to break out of the... (5 Replies)
Discussion started by: scorreg
5 Replies

2. HP-UX

Cut rows

Hi, I have a requirement to search for two words and grep all the lines between them. For e.g. : $cat file.dat abc,To,number acd,To,cnz \* flexibile select *\ bcd,To,lla anz,From,kln app,From,lpz I need to get all the lines between the lines cantaining word 'acd' and 'anz'. the... (2 Replies)
Discussion started by: obedkhan
2 Replies

3. Shell Programming and Scripting

read line in reverse order from file

dear all i want to read 5th no of line from last line of file. kindly suggest me possible ways. rgds jaydeep (2 Replies)
Discussion started by: jaydeep_sadaria
2 Replies

4. Shell Programming and Scripting

cut a field, but with reverse order

Hi Everyone, I have one a.txt: a b 001 c b b 002 c c c, not 002 c The output should be 001 002 002 If i use cut -f 3 -d' ', this does not work on the 3rd line, so i thought is any way to cut the field counting from the end? or any perl thing can do this?:confused: ... (3 Replies)
Discussion started by: jimmy_y
3 Replies

5. Shell Programming and Scripting

Print rows in reverse order if values decrease along the column

Hi, Guys. Please help me to find solution to this problem using shell scripting. I have an INPUT file with 4 columns separated by tab. Each block of records is separated by ----- ----- Sample1 5402 6680 Pattern01 Sample2 2216 2368 Pattern02... (6 Replies)
Discussion started by: sam_2921
6 Replies

6. Shell Programming and Scripting

CUT command delimiter in reverse

Hi, I've a situation where, a=xxx.yyy.zzz.txt EXTN=`echo $a | cut -d . -f2` Using the above code it delimites and will return "yyy.zzz.txt" to EXTN. But i need to get only the extension "txt". so as per the above code it delimits in the first "." itself. Can anyone help how to do... (6 Replies)
Discussion started by: skcvasanth
6 Replies

7. Shell Programming and Scripting

Cut or awk in reverse

I may be making this too hard on myself, but I'm trying to find a way that I can use a cut or awk string to always remove the last two delimited fields of a string. Say I have PackageName-U939393-8.2.3.4.s390x.rpm But the s390x could be any string w/o periods in it, x8664 for example,... (9 Replies)
Discussion started by: cbo0485
9 Replies

8. Shell Programming and Scripting

How to cut the particular string and increment the rows?

Hi am using unix aix I have tried using awk but am getting only output = x ,its not incrementing next output set -A var1 vv qa za ct=0 i=3 while do var1=`echo ${var1}` count=`awk ' NR==$i++ {print;exit}' ${.txt} | cut -c5 ` echo $count let ct=ct+1 done (6 Replies)
Discussion started by: Venkatesh1
6 Replies

9. Shell Programming and Scripting

Reverse even lines

I'm trying to reverse every even line in my file using the awk command below but it prints only the odd lines but nothing else: $ awk '(NR % 2) {print}; !(NR % 2) {print | "rev";}' myfile Any idea what I might have done wrong? Thank you. (10 Replies)
Discussion started by: ivpz
10 Replies

10. UNIX for Dummies Questions & Answers

How to cut part of a string in reverse?

Hi, how to cut part of a string sing delimiter in reverse input file 1,2,st-pa-tr-01,2,3,4, 2,3,ff-ht-05,6,7,8 how can i obtain strings till st-pa-tr ff-ht i.e cutting the last part og string -01 and -05 Thanks & Regards Nivi edit by bakunin: changed thread title (typo) (3 Replies)
Discussion started by: nivI
3 Replies
SLMBUILD(1)						User Contributed Perl Documentation					       SLMBUILD(1)

NAME
slmbuild - generate language model from idngram file SYNOPSIS
slmbuild [option]... idngram_file... DESCRIPTION
slmbuild generates a back-off smoothing language model from a given idngram file. Generally, the idngram_file is created by ids2ngram. OPTIONS All the following options are mandatory. -n,--NMax N 1 for unigram, 2 for bigram, 3 for trigram. Any number not in the range of 1..3 is not valid. -o, --out output-file Specify the output xfilei name. -l, --log using -log(pr), use pr directly by default. -w, --wordcount N Lexican size, number of different words. -b, --brk id... Set the ids which should be treated as breaker. -e, --e id... Set the ids which should not be put into LM. -c, --cut c... k-grams whose freq <= c[k] are dropped. -d, --discount method, param... The k-th -d parm specifies the discount method For k-gram, possibble values for method/param are: B<GT>,I<R>,I<dis> : B<GT> discount for r E<lt>= I<R>, r is the freq of a ngram. Linear discount for those r E<gt> I<R>, i.e. r'=r*dis 0 E<lt>E<lt> dis E<lt> 1.0, for example 0.999 B<ABS>,[I<dis>] : Absolute discount r'=r-I<dis>. And I<dis> is optional 0 E<lt>E<lt> I<dis> E<lt> cut[k]+1.0, normally I<dis> E<lt> 1.0. LIN,[I<dis>] : Linear discount r'=r*dis. And dis is optional 0 E<lt> dis E<lt> 1.0 NOTE
-n must be given before -c -b. And -c must give right number of cut-off, also -ds must appear exactly N times specifying the discounts for 1-gram, 2-gram..., respectively. BREAKER-IDs could be SentenceTokens or ParagraphTokens. Conceptually, these ids have no meaning when they appeared in the middle of n-gram. EXCLUDE-IDs could be ambiguious-ids. Conceptually, n-grams which contain those ids are meaningless. We can not erase ngrams according to BREAKER-IDS and EXCLUDE-IDs directly from IDNGRAM file, because some low-level information is still useful in it. EXAMPLE
Following example read 'all.id3gram' and write trigram model 'all.slm'. At 1-gram level, use Good-Turing discount with cut-off 0, i<R>=8, dis=0.9995. At 2-gram level, use Absolute discount with cut-off 3, dis auto-calc. At 3-gram level, use Absolute discount with cut-off 2, dis auto-calc. Word id 10,11,12 are breakers (sentence/para/paper breaker, etc). Exclude-ID is 9. Lexicon contains 200000 words. The result languagme model uses -log(pr). slmbuild -l -n 3 -o all.slm -w 200000 -c 0,3,2 -d GT,8,0.9995 -d ABS -d ABS -b 10,11,12 -e 9 all.id3gram AUTHOR
Originally written by Phill.Zhang <phill.zhang@sun.com>. Currently maintained by Kov.Chai <tchaikov@gmail.com>. SEE ALSO
ids2ngram(1), slmprune(1). perl v5.14.2 2012-06-09 SLMBUILD(1)
All times are GMT -4. The time now is 11:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy