07-16-2008
Awk Hash Function.
I have a file with a format of
A,2
B,2
G,3
A,2
A,3
A,2
D,7
A,2
E,2
A,2
I need to create a sum of each alphabet with the numbers assigned to it using awk.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a script with dynamic hash of hashes , and I want to print the entire hash (with all other hashes).
Itried to do it recursively by checking if the current key is a hash and if yes call the current function again with refference to the sub hash.
Most of the printing seems to be OK but in... (1 Reply)
Discussion started by: Alalush
1 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I am working on this idea that I want to process some information from a command dump.
Using the dump I will search for a string. If it finds the string, it must post a
different/associated string to output/logfile.
Example:
'Find "cookie jar"' then 'echo "carpool/tomorrow" >... (2 Replies)
Discussion started by: Corpsehy
2 Replies
3. Programming
I have created my own hash table class, but am looking to speed it up. My current hash function is:
int HashTable::hashFunc(const string &key) const
{
int tableSize = theLists.size();
int hashVal = 0;
for(int i = 0; i<key.length(); i++)
hashVal =... (7 Replies)
Discussion started by: killerqb
7 Replies
4. Shell Programming and Scripting
Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below.
#!/usr/bin/perl
use warnings;
use Tie::IxHash;
use strict;
tie (my %programs, "Tie::IxHash");
while (my $line = <DATA>) {
chomp $line;
my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies
5. Shell Programming and Scripting
Hi,
I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all .
my %result (
$abc => {
'data_count' => '10',
'ID' => 'ABC122',
}
$def => {
'data_count' => '20',
'ID' => 'defASe',
... (1 Reply)
Discussion started by: asak
1 Replies
6. Shell Programming and Scripting
Hello gurus, Iam trying to parse following BibTex file (bibliography.bib):
@book{Lee2000a,
abstract = {Abstract goes here},
author = {Lee, Wenke and Stolfo, Salvatore J},
title = {{Data mining approaches for intrusion detection}},
year = {2000}
}
@article{Forrest1996,
abstract =... (0 Replies)
Discussion started by: wakatana
0 Replies
7. Shell Programming and Scripting
I'm new to awk command.
The HASH ARRAY is not printing. Merging 2 files togather.
vault_input.txt
3P04_Dep_Inxml:2230
REM02_Dep_Inxml:2200
REM03_Dep_Inxml:2400
REM05:2200
REM06:2200
tst6.txt
Nov:10:2115:3P04_Dep_Inxml
Nov:10:2129:REM02_Dep_Inxml
Nov:10:2235:REM03_Dep_Inxml... (5 Replies)
Discussion started by: Sanj123
5 Replies
8. Shell Programming and Scripting
Hi, I have a hash of hash where it has
name, activities and count
i have data like this -
$result->{$name}->{$activities} = $value;
content of that are -
name - robert tom cat peter
activities - running, eating, sleeping , drinking, work
i need to print output as below
... (3 Replies)
Discussion started by: asak
3 Replies
9. Shell Programming and Scripting
Hi,
I am having script which contains many functions. Need to print each function name at the starting of the function. Like below,
functionname()
{
echo "functionname"
commands....
}
I've tried like below,
func=`grep "()" scriptname | cut -d "(" -f1`
for i in $func
do
nawk -v... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
LEARN ABOUT DEBIAN
bio::symbol::alphabet
Bio::Symbol::Alphabet(3pm) User Contributed Perl Documentation Bio::Symbol::Alphabet(3pm)
NAME
Bio::Symbol::Alphabet - BSANE/BioCORBA compliant symbol list alphabet
SYNOPSIS
{
my $alphabet = Bio::Symbols::Alphabet->new(-symbols => [ @s ],
-subalphabets => [ @alphas ] );
my @symbols = $alphabet->symbols;
my @subalphas = $alphabet->alphabets;
if( $alphabet->contains($symbol) ) {
# do something
}
}
DESCRIPTION
Alphabet contains set of symbols, which can be concatenated to form symbol lists. Sequence string, for example, is stringified
representation of the symbol list (tokens of symbols).
This module was implemented for the purposes of meeting the BSANE/BioCORBA spec 0.3 only.
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the
Bioperl mailing list. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address
it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the
web:
https://redmine.open-bio.org/projects/bioperl/
AUTHOR - Jason Stajich
Email jason@bioperl.org
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : new
Usage : my $obj = Bio::Symbol::Alphabet->new();
Function: Builds a new Bio::Symbol::Alphabet object
Returns : Bio::Symbol::Alphabet
Args : -symbols => Array ref of Bio::Symbol::SymbolI objects
-subalphas=> Array ref of Bio::Symbol::AlphabetI objects
representing sub alphabets
AlphabetI Interface methods
symbols
Title : symbols
Usage : my @symbols = $alphabet->symbols();
Function: Get/Set Symbol list for an alphabet
List of symbols, which make up this alphabet.
Returns : Array of Bio::Symbol::SymbolI objects
Args : (optionalalphabets) Array of Bio::Symbol::SymbolI objects
alphabets
Title : alphabets
Usage : my @alphabets = $alphabet->alphabets();
Function: Get/Set Sub Alphabet list for an alphabet
Sub-alphabets. E.g. codons made from DNAxDNAxDNA alphabets
Returns : Array of Bio::Symbol::AlphabetI objects
Args : (optional) Array of Bio::Symbol::AlphabetI objects
contains
Title : contains
Usage : if($alphabet->contains($symbol)) { }
Function: Tests of Symbol is contained in this alphabet
Returns : Boolean
Args : Bio::Symbol::SymbolI
perl v5.14.2 2012-03-02 Bio::Symbol::Alphabet(3pm)