Sponsored Content
Full Discussion: Extract Field from a file
Top Forums Shell Programming and Scripting Extract Field from a file Post 302556641 by michaelrozar17 on Monday 19th of September 2011 08:48:57 AM
Old 09-19-2011
Did you try Sed or other awk solutions..?
Code:
grep -oE '[0-9]{9,}' inputfile # assuming minimum of 9 digits for Acc numbers

This User Gave Thanks to michaelrozar17 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Trying to extract a field from /etc/passwd file..

Hello, was looking for some help on extracting a field from the passwd file. So far I have made a copy of the passwd file and changed my rights so I can edit it. Every user's password is coded as an :x:, and my goal was to change that x to a blank, and then try to extract any user with that field... (2 Replies)
Discussion started by: xBuRnTx
2 Replies

2. UNIX for Dummies Questions & Answers

extract a field by logic

below are the contents of file 'tmp.out': 2|34|534| 1|355|54| 1|443|34| 3|43|768| 3|7|887| 1|9|990| How do I extract the 2nd and 3rd columns of file 'tmp.out' only when the first column equals '1'. Note that this file will be huge; atleast 5million+ rows, so I want to avoid looping... (4 Replies)
Discussion started by: ChicagoBlues
4 Replies

3. Shell Programming and Scripting

how to extract last occurence of the field

path = /first/second/third/fourth. i want to extract /first/second/third from path.my program something like this .... path=/first/second/third/fourth noc=`echo $path|tr '/' '\n'|wc -w` var='echo $noc|cut -d'/' -f 1-$noc --> is giving error. why $noc is not working here.any other... (3 Replies)
Discussion started by: kcp_pavan
3 Replies

4. Shell Programming and Scripting

Extract data into file with specific field specs

:confused: I have a tab delimited file that I need to extract data from and into a file with specific field specs. Each field has to be a certain amount of characters. So, the name field (from delimited file) might have only 15 characters but needs to be 25 (in new file) so I need to insert spaces... (5 Replies)
Discussion started by: criddel
5 Replies

5. UNIX for Dummies Questions & Answers

Extract Field Value from XML file

Hi, Within a UNIX shell script I need to extract a value from an XML field. The field will contain different values but will always be 6 digits in length. E.g.: <provider-id>999999</provider-id> I've tried various ways but no luck. Any ideas how I might get the provider id (in this case... (2 Replies)
Discussion started by: pnclayt11
2 Replies

6. Shell Programming and Scripting

Extract file records based on some field conditions

Hello Friends, I have a file(InputFile.csv) with the following columns(the columns are pipe-delimited): ColA|ColB|ColC|ColD|ColE|ColF Now for this file, I have to get those records which fulfil the following condition: If "ColB" is NOT NULL and "ColD" has values one of the following... (9 Replies)
Discussion started by: mehimadri
9 Replies

7. Shell Programming and Scripting

extract data in a csv file based on a certain field.

I have a csv file that I need to extract some data from depending on another field after reading info from another text file. The text file would say have 592560 in it. The csv file may have some data like so Field 1 Field2 Field3 Field4 Field5 Field6 20009756 1 ... (9 Replies)
Discussion started by: GroveTuckey
9 Replies

8. Shell Programming and Scripting

Extract a nth field from a comma delimited file

Hi, In my file (which is "," delimited and text qualifier is "), I have to extract a particualr field. file1: 1,"aa,b",4 expected is the 2nd field: aa,b I tried the basic cut -d "," -f 2 file 1, this gave me aa alone instead aa,b. A small hint ot help on this will be very... (5 Replies)
Discussion started by: machomaddy
5 Replies

9. Shell Programming and Scripting

Extract lines whose third field is 0

Hi, I have a file with colon separated values like below. How can i get those lines whose third field is 0 (zero). In the below example, lines starting with stapler and tempo has its third field as 0 $ cat list.txt galaxy:b:5:world stapler:a:0:hello abc:a:4:stomper kepler:uic:5:jam... (8 Replies)
Discussion started by: John K
8 Replies

10. UNIX for Beginners Questions & Answers

Command to extract empty field in a large UNIX file?

Hi All, I have records in unix file like below. In this file, we have empty fields from 4th Column to 22nd Column. I have some 200000 records in a file. I want to extract records only which have empty fields from 4th field to 22nd filed. This file is comma separated file. what is the unix... (2 Replies)
Discussion started by: rakeshp
2 Replies
Mail::Message::Field::Flex(3pm) 			User Contributed Perl Documentation			   Mail::Message::Field::Flex(3pm)

NAME
Mail::Message::Field::Flex - one line of a message header INHERITANCE
Mail::Message::Field::Flex is a Mail::Message::Field is a Mail::Reporter DESCRIPTION
This is the flexible implementation of a field: it can easily be extended because it stores its data in a hash and the constructor ("new") and initializer ("init") are split. However, you pay the price in performance. Mail::Message::Field::Fast is faster (as the name predicts). OVERLOADED
overload: ""() See "OVERLOADED" in Mail::Message::Field overload: +0() See "OVERLOADED" in Mail::Message::Field overload: <=>() See "OVERLOADED" in Mail::Message::Field overload: bool() See "OVERLOADED" in Mail::Message::Field overload: cmp() See "OVERLOADED" in Mail::Message::Field METHODS
Constructors $obj->clone() See "Constructors" in Mail::Message::Field Mail::Message::Field::Flex->new(DATA) If you stick to this flexible class of header fields, you have a bit more facilities than with Mail::Message::Field::Fast. Amongst it, you can specify options with the creation. Possible arguments: o new LINE ass a LINE as it could be found in a file: a (possibly folded) line which is terminated by a new-line. o new NAME, (BODY|OBJECTS), [ATTRIBUTES], OPTIONS A set of values which shape the line. To be able to distinguish the different parameters, you will have to specify the OPTIONS as ARRAY of option pairs, or HASH of options. The ATTRIBUTES are a flat list of key-value pairs. The body is specified as one BODY string, one OBJECT, or a reference to an array of OBJECTS. See Mail::Message::Field: -Option --Defined in --Default attributes [] comment undef log Mail::Reporter 'WARNINGS' trace Mail::Reporter 'WARNINGS' attributes => ATTRS Reference to array with list of key-value pairs representing attributes, or reference to a hash containing these pairs. This is an alternative notation for specifying ATTRIBUTES directly as method arguments. comment => STRING A pre-formatted list of attributes. log => LEVEL trace => LEVEL The field $obj->isStructured() Mail::Message::Field::Flex->isStructured() See "The field" in Mail::Message::Field $obj->length() See "The field" in Mail::Message::Field $obj->nrLines() See "The field" in Mail::Message::Field $obj->print([FILEHANDLE]) See "The field" in Mail::Message::Field $obj->size() See "The field" in Mail::Message::Field $obj->string([WRAP]) See "The field" in Mail::Message::Field $obj->toDisclose() See "The field" in Mail::Message::Field Access to the name $obj->Name() See "Access to the name" in Mail::Message::Field $obj->name() See "Access to the name" in Mail::Message::Field $obj->wellformedName([STRING]) See "Access to the name" in Mail::Message::Field Access to the body $obj->body() See "Access to the body" in Mail::Message::Field $obj->folded() See "Access to the body" in Mail::Message::Field $obj->foldedBody([BODY]) See "Access to the body" in Mail::Message::Field $obj->stripCFWS([STRING]) Mail::Message::Field::Flex->stripCFWS([STRING]) See "Access to the body" in Mail::Message::Field $obj->unfoldedBody([BODY, [WRAP]]) See "Access to the body" in Mail::Message::Field Access to the content $obj->addresses() See "Access to the content" in Mail::Message::Field $obj->attribute(NAME [, VALUE]) See "Access to the content" in Mail::Message::Field $obj->attributes() See "Access to the content" in Mail::Message::Field $obj->comment([STRING]) See "Access to the content" in Mail::Message::Field $obj->study() See "Access to the content" in Mail::Message::Field $obj->toDate([TIME]) Mail::Message::Field::Flex->toDate([TIME]) See "Access to the content" in Mail::Message::Field $obj->toInt() See "Access to the content" in Mail::Message::Field Other methods $obj->dateToTimestamp(STRING) Mail::Message::Field::Flex->dateToTimestamp(STRING) See "Other methods" in Mail::Message::Field Internals $obj->consume(LINE | (NAME,BODY|OBJECTS)) See "Internals" in Mail::Message::Field $obj->defaultWrapLength([LENGTH]) See "Internals" in Mail::Message::Field $obj->fold(NAME, BODY, [MAXCHARS]) Mail::Message::Field::Flex->fold(NAME, BODY, [MAXCHARS]) See "Internals" in Mail::Message::Field $obj->setWrapLength([LENGTH]) See "Internals" in Mail::Message::Field $obj->stringifyData(STRING|ARRAY|OBJECTS) See "Internals" in Mail::Message::Field $obj->unfold(STRING) See "Internals" in Mail::Message::Field Error handling $obj->AUTOLOAD() See "Error handling" in Mail::Reporter $obj->addReport(OBJECT) See "Error handling" in Mail::Reporter $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) Mail::Message::Field::Flex->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) See "Error handling" in Mail::Reporter $obj->errors() See "Error handling" in Mail::Reporter $obj->log([LEVEL [,STRINGS]]) Mail::Message::Field::Flex->log([LEVEL [,STRINGS]]) See "Error handling" in Mail::Reporter $obj->logPriority(LEVEL) Mail::Message::Field::Flex->logPriority(LEVEL) See "Error handling" in Mail::Reporter $obj->logSettings() See "Error handling" in Mail::Reporter $obj->notImplemented() See "Error handling" in Mail::Reporter $obj->report([LEVEL]) See "Error handling" in Mail::Reporter $obj->reportAll([LEVEL]) See "Error handling" in Mail::Reporter $obj->trace([LEVEL]) See "Error handling" in Mail::Reporter $obj->warnings() See "Error handling" in Mail::Reporter Cleanup $obj->DESTROY() See "Cleanup" in Mail::Reporter $obj->inGlobalDestruction() See "Cleanup" in Mail::Reporter DIAGNOSTICS
Warning: Field content is not numerical: $content The numeric value of a field is requested (for instance the "Lines" or "Content-Length" fields should be numerical), however the data contains weird characters. Warning: Illegal character in field name $name A new field is being created which does contain characters not permitted by the RFCs. Using this field in messages may break other e-mail clients or transfer agents, and therefore mutulate or extinguish your message. Error: Package $package does not implement $method. Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. SEE ALSO
This module is part of Mail-Box distribution version 2.105, built on May 07, 2012. Website: http://perl.overmeer.net/mailbox/ LICENSE
Copyrights 2001-2012 by [Mark Overmeer]. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2012-05-07 Mail::Message::Field::Flex(3pm)
All times are GMT -4. The time now is 06:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy