Sponsored Content
Full Discussion: Grep Headers
Top Forums UNIX for Dummies Questions & Answers Grep Headers Post 302354711 by Franklin52 on Saturday 19th of September 2009 12:58:52 PM
Old 09-19-2009
With awk you can do something like:

Code:
awk 'NR<3{print} /CARRIERSS7/' file

 

10 More Discussions You Might Find Interesting

1. Programming

C Headers

Where can i get C/C++ headers for OS MINIX 2.0.3? (0 Replies)
Discussion started by: biosdos
0 Replies

2. Programming

headers of the query

when we are spooling query o/p to certain txt file,in that file how we can get headers in the query.(through unix shell scripting). for exmple q1="slect * from XXXXXX;"; sqlplus XXX/XXXX@XXXXX spool XXXX.txt $q1 spool off in the text file i want the headers of the query..... ... (0 Replies)
Discussion started by: bhagya.puccha
0 Replies

3. Shell Programming and Scripting

Remove text between headers while leaving headers intact

Hi, I'm trying to strip all lines between two headers in a file: ### BEGIN ### Text to remove, contains all kinds of characters ... Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c om/updates/ Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies

4. Shell Programming and Scripting

Merging of files with different headers to make combined headers file

Hi , I have a typical situation. I have 4 files and with different headers (number of headers is varible ). I need to make such a merged file which will have headers combined from all files (comman coluns should appear once only). For example - File 1 H1|H2|H3|H4 11|12|13|14 21|22|23|23... (1 Reply)
Discussion started by: marut_ashu
1 Replies

5. Shell Programming and Scripting

How to pull info under headers in file(awk,grep,while loop)

below is an extract from my file and I am trying to use Awk and grep and a while loop to pull infomation from under neath "HBA WWN=".HBA WWN=" reoccurs all over the file but the 100000c.....number are unique and I want to be able to pull and reference specifi information under this header ever time... (2 Replies)
Discussion started by: kieranfoley
2 Replies

6. Programming

c - problem with headers?

I have a simple program to create a poker deck, shuffle it and deal cards. Here it is: #include <stdio.h> #include <stdlib.h> #include <time.h> struct Card { char *face, *suit; }; void fillDeck (Card *deck, char *face, char *suit); void shuffle (Card *deck); void... (4 Replies)
Discussion started by: Luke Bonham
4 Replies

7. Shell Programming and Scripting

Editing headers

Hi, I have a folder that contains many (multiple) files 1.fasta 2.fasta 3.fasta 4.fasta 5.fasta . . 100's of files Each such file have data in the following format for example: vi 1.fasta >AB_1 200bp MLKKPIIIGVTGGSGGGKTSVSRAILDSFPNARIAMIQHDSYYKDQSHMSFEERVKTNYDHPLAFDTDFM... (4 Replies)
Discussion started by: Lucky Ali
4 Replies

8. Shell Programming and Scripting

editing headers

Hi, I have a folder that contains many (multiple) files 1.fasta 2.fasta 3.fasta 4.fasta 5.fasta . . 100's of files Each such file have data in the following format for example: vi 1.fasta 58 390 A GTATACATTATTGATGAAGTCCACATGCTTTCTATGGGTGCCTTCAATGCGCTTTTAAAA (7 Replies)
Discussion started by: Lucky Ali
7 Replies

9. UNIX for Dummies Questions & Answers

Modifying headers

I have a FASTA file with thousands of sequences that looks something like this: I need to modfy the header in such way that everything after the dot is remove. Thus, I will end up with something like this: Thanks (1 Reply)
Discussion started by: Xterra
1 Replies

10. UNIX for Dummies Questions & Answers

Email Headers

I'm trying to pick up some Unix SysAdmin skills on my own outside of work through the use of the "Unix and Linux System Administrators Handbook." I've found the exercises to be very beneficial, until I came to this.... "What path did the email take? To Whom was it addressed, and to whom was it... (0 Replies)
Discussion started by: ksmarine1980
0 Replies
Courriel::Headers(3pm)					User Contributed Perl Documentation				    Courriel::Headers(3pm)

NAME
Courriel::Headers - The headers for an email part VERSION
version 0.29 SYNOPSIS
my $email = Courriel->parse( text => ... ); my $headers = $email->headers; print "$_ " for $headers->get('Received'); DESCRIPTION
This class represents the headers of an email. Any sub part of an email can have its own headers, so every part has an associated object representing its headers. This class makes no distinction between top-level headers and headers for a sub part. Each individual header name/value pair is represented internally by a Courriel::Header object. Some headers have their own special subclass. These are: o Content-Type This is stored as a Courriel::Header::ContentType object. o Content-Disposition This is stored as a Courriel::Header::Disposition object. API
This class supports the following methods: Courriel::Headers->parse( ... ) This method creates a new object by parsing a string. It accepts the following parameters: o text The text to parse. This can either be a plain scalar or a reference to a scalar. If you pass a reference, the underlying scalar may be modified. o line_sep The line separator. This default to a " ", but you can change it if necessary. Note that this only affects parsing, header objects are always output with RFC-compliant line endings. Header parsing unfolds folded headers, and decodes any MIME-encoded values as described in RFC 2047. Parsing also decodes header attributes encoded as described in RFC 2231. Courriel::Headers->new( headers => [ ... ] ) This method creates a new object. It accepts one parameter, "headers", which should be an array reference of header names and values. A given header key can appear multiple times. This object does not (yet, perhaps) enforce RFC restrictions on repetition of certain headers. Header order is preserved, per RFC 5322. $headers->get($name) Given a header name, this returns a list of the Courriel::Header objects found for the header. Each occurrence of the header is returned as a separate object. $headers->get_values($name) Given a header name, this returns a list of the string values found for the header. Each occurrence of the header is returned as a separate string. $headers->add( $name => $value ) Given a header name and value, this adds the headers to the object. If any of the headers already have values in the object, then new values are added after the existing values, rather than at the end of headers. The value can be provided as a string or a Courriel::Header object. $headers->unshift( $name => $value ) This is like "add()", but this pushes the headers onto the front of the internal headers array. This is useful if you are adding "Received" headers, which per RFC 5322, should always be added at the top of the headers. The value can be provided as a string or a Courriel::Header object. $headers->remove($name) Given a header name, this removes all instances of that header from the object. $headers->replace( $name => $value ) A shortcut for calling "remove()" and "add()". The value can be provided as a string or a Courriel::Header object. $headers->as_string( skip => ...., charset => ... ) This returns a string representing the headers in the object. The values will be folded and/or MIME-encoded as needed. The "skip" parameter should be an array reference containing the name of headers that should be skipped. This parameter is optional, and the default is to include all headers. The "charset" parameter specifies what character set to use for MIME-encoding non-ASCII values. This defaults to "utf8". The charset name must be one recognized by the Encode module. MIME encoding is always done using the "B" (Base64) encoding, never the "Q" encoding. $headers->stream_to( output => $output, skip => ...., charset => ... ) This method will send the stringified headers to the specified output. See the "as_string()" method for documentation on the "skip" and "charset" parameters. ROLES
This class does the "Courriel::Role::Streams" role. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-03-07 Courriel::Headers(3pm)
All times are GMT -4. The time now is 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy