06-15-2019
Understood, but when I added field seperator and tried $6 as well as other values till $12 no one gave me 8. Where might be the problem?
10 More Discussions You Might Find Interesting
1. Web Development
Hi,
For example lets consider i have word like this:cell
I have some text that is stored in table.
These are few sentences.
TRAP also regulates translation of trpE by promoting formation of an cell.
In addition initiation of pabA, trpP and ycbK by directly blocking cells.
I... (0 Replies)
Discussion started by: vanitham
0 Replies
2. Shell Programming and Scripting
hi I hace a string
"abc,def,ghi,abc,def ,ghi,abc,def,ghi,abc,def ,ghi,abc"
i replaced commas with spaces, now i want to calculate nof occurences of "abc" word.
thanks in advance
Satya (6 Replies)
Discussion started by: Satyak
6 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I want to count the occurences of a specific word in a .txt file in bash shell.
Can somebody help me pleaze??
Thanks!!! (2 Replies)
Discussion started by: mskart
2 Replies
4. Shell Programming and Scripting
I have enclosed the script. I am able to find the files that contain my search string but when I try to count the occurences within the file I get zero always. Any help on this.
#!/usr/bin/perl
my $find = $ARGV;
my $replace = $ARGV;
my $glob = $ARGV;
@filelist = <*$glob>;
# process each... (22 Replies)
Discussion started by: TimHortons
22 Replies
5. UNIX for Dummies Questions & Answers
I want to count the number of occurences of say "200" in a file but that file also contains various stuff including dtaes like 2007 or smtg like 200.1 so count i am getting by doing grep -c "word" file is wrong
Please help!!!!! (8 Replies)
Discussion started by: shikhakaul
8 Replies
6. Shell Programming and Scripting
Hi,
i am in need of an awk script to accomplish the following:
Input table looks like:
Student1 arts
Student2 science
Student3 arts
Student4 science
Student5 science
Student6 science
Student7 science
Student8 science
Student9 science
Student10 science
Student11 science... (8 Replies)
Discussion started by: saint2006
8 Replies
7. Shell Programming and Scripting
Hi,
Please help me in finding the number of occurences of the string.
Example: Apple, green, blue, Apple, Orange, green, blue are the strings can be even in the next line.
The o/p should look as:
Word Count
----- -----
Apple 2
green 2
Orange 1
blue 2
Thanks (2 Replies)
Discussion started by: acc888
2 Replies
8. UNIX for Dummies Questions & Answers
hi,
I have a text..and i need to find a pattern in the text and count to the no of times the pattern occured.
i have used grep command ..but the problem is , it shows the occurrences of the pattern but doesn't count no of times the pattern occuries. (5 Replies)
Discussion started by: nvnni
5 Replies
9. Shell Programming and Scripting
line number:status, market, keystation
1,SENT,EBS,1 : 1
2,DONE,REU,1 : 1
3,SENT,EBS,2 : 1
4,DONE,EBS,1 : 0
5,SENT,EBS,2 : 0
6,SENT,EBS,2 : 0
7,SENT,EBS,2 : 0
8,SENT,EBS,1 : 1
for each status, market combination I want to keep a tally of active orders. i.e if an order is SENT, then +1, if... (8 Replies)
Discussion started by: Calypso
8 Replies
10. Shell Programming and Scripting
I have some text files in a folder f1 with 10 columns. The first five columns of a file are shown below.
aab abb 263-455 263 455
aab abb 263-455 263 455
aab abb 263-455 263 455
bbb abb 26-455 26 455
bbb abb 26-455 26 455
bbb aka 264-266 264 266
bga bga 230-232 230 ... (10 Replies)
Discussion started by: gomez
10 Replies
LEARN ABOUT DEBIAN
swiss::textfunc
SWISS::TextFunc(3pm) User Contributed Perl Documentation SWISS::TextFunc(3pm)
NAME
SWISS::TextFunc
DESCRIPTION
This module is designed to be a repository of functions that are repeatedly used during parsing and formatting of SWISS-PROT/TREMBL lines.
If more than two line types need to do aproximately the same thing then it is probably in here.
All functions expect to be called as package->function(param list)
listFromText
Takes a piece of text, a seperator regex and a seperator that may appear at the end. Returns an array of items that were seperated in
the text by that seperator. Takes care of null items (looses them for you).
textFromList
Takes an array of items, a separator, a terminating string, and a line width. Returns an array of strings, each ending with the
separator or the terminator with a width less than or equal to the width specified.
Seems to do the wrong thing for references - not sure why. Don't use it for that.
wrapText
Takes a string and a length. Returns an array of strings which are shorter or equal in length to length, spliting the string on white
space.
wrapOn ($firstLinePrefix, $linePrefix, $colums, $text[, @separators])
Wraps $text into lines with at most $colums colums. Prepends the prefixes to the lines. @separators is a list of expressions on which
to wrap. The expression itself is part of the upper line.
If no @separators are provided, the $text is wrapped at whitespace except in EC/TC numbers or at dashes that separate words.
First tries to wrap on the first item of @separators, then the next etc. If no wrap on any element of @separators or whitespaces is
possible, wraps into lines of exactly length $colums.
A special case is that the first item of @separators may be a reference to an array. This is used internally for wrapping FT VARIANT-
like lines.
Example:
wrapOn('DE ', 'DE ', 40,
'14-3-3 PROTEIN BETA/ALPHA (PROTEIN KINASE C INHIBITOR PROTEIN-1)',
's+')
returns ['14-3-3 PROTEIN BETA/ALPHA (PROTEIN ',
'KINASE C INHIBITOR PROTEIN-1)']
wrapOn('DE ', 'DE ', 40,
'14-3-3 PROTEIN BETA/ALPHA (PROTEIN KINASE C INHIBITOR PROTEIN-1)',
' (?=()', 's+')
returns ['14-3-3 PROTEIN BETA/ALPHA ',
'(PROTEIN KINASE C INHIBITOR PROTEIN-1)']
cleanLine
Remove the leading line Identifier and three blanks and trailing spaces from an SP line.
joinWith ($text, $with, $noAddAfter, @list)
Concatenates $text and @list into one string. Adds $with between the original elements, unless the postfix of the current string is
$noAddAfter. This is used to avoid inserting blanks after hyphens during concatenation. So unpleasant strings like 'CALMODULIN-
DEPENDENT' are avoided. Unfortunately a correct reassembly of strings like 'CARBON-DIOXIDE' is not done.
insertLineGroup ($textRef, $text, $pattern)
Inserts text block $text into the text referred to by $textRef. $text will replace the text block in $textRef matched by $pattern.
uniqueList (@list)
Returns a list in which all duplicates from @list have been removed.
currentSpDate
returns the current date in SWISS-PROT format
toMixedCase($text, @regexps)
Convert a text to mixed case, according to one or more regular expressions. In scalar context, returns the new text; in array context,
also returns the regexp with which the change was performed, or undef on failure. See corresponding item in SWISS::GN for more
details.
perl v5.10.1 2006-08-31 SWISS::TextFunc(3pm)