Sponsored Content
Top Forums UNIX for Beginners Questions & Answers awk script to extract transcript information from gff3 file Post 303043983 by Maduranga on Wednesday 12th of February 2020 04:36:37 AM
Old 02-12-2020
Thank you so much, this works perfectly.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK to extract information

Hi all, I am working on a shell script to extract information from a file that has output from Oracle sqlplus. The problem is that the output of a single line is spread across multiple lines and i do not know as how to extract the particular filed at ones,which spans multiple lines.... (2 Replies)
Discussion started by: harris2107
2 Replies

2. Shell Programming and Scripting

extract and format information from a file

Hi, Following is sample portion of the file; <JDBCConnectionPool DriverName="oracle.jdbc.OracleDriver" MaxCapacity="10" Name="MyApp_DevPool" PasswordEncrypted="{3DES}7tXFH69Xg1c=" Properties="user=MYAPP_ADMIN" ShrinkingEnabled="false" ... (12 Replies)
Discussion started by: sujoy101
12 Replies

3. UNIX for Dummies Questions & Answers

Write a script to extract information from a db

Hi I need to put together a script that will search certain tables in a db and send that data to a csv file. Basically I am importing data to a db and I want to write a script to check that all information was imported correctly. Thank you (1 Reply)
Discussion started by: ladyAnne
1 Replies

4. Shell Programming and Scripting

Create shell script to extract unique information from one file to a new file.

Hi to all, I got this content/pattern from file http.log.20110808.gz mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1 mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Discussion started by: Mr_47
16 Replies

5. Shell Programming and Scripting

How to extract information from a file?

Hi, i have a file like this: <Iteration> <Iteration_iter-num>3</Iteration_iter-num> <Iteration_query-ID>lcl|3_0</Iteration_query-ID> <Iteration_query-def>G383C4U01EQA0A length=197</Iteration_query-def> <Iteration_query-len>197</Iteration_query-len> ... (9 Replies)
Discussion started by: the_simpsons
9 Replies

6. Shell Programming and Scripting

Help with shell script to extract certain information

Hi, I have a file which I need to programmatically split into two files. All the information in the file before pattern "STOP HERE" is to be stripped and output into one file while everything after "STOP HERE" is to be output into a separate file. I would appreciate help on how to do... (8 Replies)
Discussion started by: PTL
8 Replies

7. Shell Programming and Scripting

awk script to parse case with information in two fields of file

The below awk parser works for most data inputs, but I am having trouble with the last one. The problem is in the below rules steps 1 and 2 come from $2 (NC_000013.10:g.20763686_20763687delinsA) and steps 3 and 4 come from $1 (NM_004004.5:c.34_35delGGinsT). Parse Rules: The header is... (0 Replies)
Discussion started by: cmccabe
0 Replies

8. Shell Programming and Scripting

Extract information from file

Gents, If is possible please help. I have a big file (example attached) which contends exactly same value in column, but from column 2 to 6 these values are diff. I will like to compile for all records all columns like the example attached in .csv format (output.rar ).. The last column in the... (11 Replies)
Discussion started by: jiam912
11 Replies

9. Shell Programming and Scripting

Extract information from file

In a particular directory, there can be 1000 files like below. filename is job901.ksh #!/bin/ksh cront -x << EOJ submit file=$PRODPATH/scripts/genReport.sh maxdelay=30 &node=xnode01 tname=job901 &pfile1=/prod/mldata/data/test1.dat ... (17 Replies)
Discussion started by: vedanta
17 Replies

10. Shell Programming and Scripting

sed / awk / grep to extract information from log

Hi all, I have a query that runs that outputs data in the following format - 01/09/12 11:43:40,ADMIN,4,77,Application Group Load: Name(TESTED) LoadId(5137-1-0-1XX-15343-15343) File(/dir/dir/File.T03.CI2.RYR.2012009.11433350806.ARD) InputSize(5344) OutputSize(1359) Rows(2) Time(1.9960)... (8 Replies)
Discussion started by: jeffs42885
8 Replies
Moose::Manual::Delegation(3pm)				User Contributed Perl Documentation			    Moose::Manual::Delegation(3pm)

NAME
Moose::Manual::Delegation - Attribute delegation VERSION
version 2.0603 WHAT IS DELEGATION
? Delegation is a feature that lets you create "proxy" methods that do nothing more than call some other method on an attribute. This lets you simplify a complex set of "has-a" relationships and present a single unified API from one class. With delegation, consumers of a class don't need to know about all the objects it contains, reducing the amount of API they need to learn. Delegations are defined as a mapping between one or more methods provided by the "real" class (the delegatee), and a set of corresponding methods in the delegating class. The delegating class can re-use the method names provided by the delegatee or provide its own names. Delegation is also a great way to wrap an existing class, especially a non-Moose class or one that is somehow hard (or impossible) to subclass. DEFINING A MAPPING
Moose offers a number of options for defining a delegation's mapping, ranging from simple to complex. The simplest form is to simply specify a list of methods: package Website; use Moose; has 'uri' => ( is => 'ro', isa => 'URI', handles => [qw( host path )], ); With this definition, we can call "$website->host" and it "just works". Under the hood, Moose will call "$website->uri->host" for you. Note that $website is not automatically passed to the "host" method; the invocant is "$website->uri". We can also define a mapping as a hash reference. This allows you to rename methods as part of the mapping: package Website; use Moose; has 'uri' => ( is => 'ro', isa => 'URI', handles => { hostname => 'host', path => 'path', }, ); In this example, we've created a "$website->hostname" method, rather than using "URI.pm"'s name, "host". These two mapping forms are the ones you will use most often. The remaining methods are a bit more complex. has 'uri' => ( is => 'ro', isa => 'URI', handles => qr/^(?:host|path|query.*)/, ); This is similar to the array version, except it uses the regex to match against all the methods provided by the delegatee. In order for this to work, you must provide an "isa" parameter for the attribute, and it must be a class. Moose uses this to introspect the delegatee class and determine what methods it provides. You can use a role name as the value of "handles": has 'uri' => ( is => 'ro', isa => 'URI', handles => 'HasURI', ); Moose will introspect the role to determine what methods it provides and create a mapping for each of those methods. Finally, you can also provide a sub reference to generate a mapping. You probably won't need this version often (if ever). See the Moose docs for more details on exactly how this works. NATIVE DELEGATION
Native delegations allow you to delegate to standard Perl data structures as if they were objects. has 'queue' => ( traits => ['Array'], isa => 'ArrayRef[Item]', default => sub { [ ] }, handles => { add_item => 'push', next_item => 'shift', }, ) The "Array" trait in the "traits" parameter tells Moose that you would like to use the set of Array helpers. Moose will then create "add_item" and "next_item" methods that "just work". Behind the scenes "add_item" is something like sub add_item { my ($self, @items) = @_; for my $item (@items) { $Item_TC->validate($item); } push @{ $self->queue }, @items; } Moose includes the following traits for native delegation: o Array o Bool o Code o Counter o Hash o Number o String CURRYING
Currying allows you to create a method with some pre-set parameters. You can create a curried delegation method: package Spider; use Moose; has request => ( is => 'ro' isa => 'HTTP::Request', handles => { set_user_agent => [ header => 'UserAgent' ], }, ) With this definition, calling "$spider->set_user_agent('MyClient')" will call "$spider->request->header('UserAgent', 'MyClient')" behind the scenes. Note that with currying, the currying always starts with the first parameter to a method ($_[0]). Any arguments you pass to the delegation come after the curried arguments. MISSING ATTRIBUTES
It is perfectly valid to delegate methods to an attribute which is not required or can be undefined. When a delegated method is called, Moose will throw a runtime error if the attribute does not contain an object. AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for details. COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-28 Moose::Manual::Delegation(3pm)
All times are GMT -4. The time now is 12:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy