Sponsored Content
Top Forums Shell Programming and Scripting Ranking data points from multiple files Post 302978664 by ncwxpanther on Tuesday 2nd of August 2016 10:19:33 AM
Old 08-02-2016
Don, All of your assumptions are spot on. But as an update:

The output is still printing out the rank of every field 1 and field 2 data point for all 100+ files. Even though I am only interested in the fields 1 and 2 of the Month and Year within the control file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to extarct data points

suppose u have a file which consist of many data points separated by asterisk Question is to extract third part in each line . 0.0002*0.003*-0.93939*0.0202*0.322*0.3332*0.2222*0.22020 0.003*0.3333*0.33322*-0.2220*0.3030*0.2222*0.3331*-0.3030 0.0393*0.3039*-0.03038*0.033*0.4033*0.30384*0.4048... (5 Replies)
Discussion started by: cdfd123
5 Replies

2. Shell Programming and Scripting

recoding data points using SED??

Hello all, I have a data file that needs some serious work...I have no idea how to implement the changes that are needed! The file is a genotypic file with >64,000 columns representing genetic markers, a header line, and >1100 rows that looks like this: ID 1 2 3 4 ... (7 Replies)
Discussion started by: doobedoo
7 Replies

3. Shell Programming and Scripting

Group search (multiple data points) in Linux

Hi All I have a data set like this tab delimited: weft fgr-1 345 -1 fgrythdgd weft fgr-3 456 -2 ghjdklflllff weft fgr-11 456 -3 ghtjuffl weft fgr-1 213 -2 ghtyjdkl weft fgr-34 567 -5 fghytkflf frgt fgr-36 567 -1 ghrjufjf frgt fgr-45 678 -2 ghjruir frgt fgr-34 546 -5 gjjjgkldlld frgt... (4 Replies)
Discussion started by: Lucky Ali
4 Replies

4. UNIX for Dummies Questions & Answers

How to get data only inside polygon created by points which is part of whole data from file?

hiii, Help me out..i have a huge set of data stored in a file.This file has has 2 columns which is latitude & longitude of a region. Now i have a program which asks for the number of points & based on this number it asks the user to enter that latitude & longitude values which are in the same... (7 Replies)
Discussion started by: reva
7 Replies

5. Programming

GNUPLOT- how to change the style of data points

Hi, I am trying to arrange my graphs with GNUPLOT. Although it looked like simple at the beginning, I could not figure out an answer for the following: I want to change the style of my data points (not the line, just exact data points) The terminal assigns first + and then x to them but what I... (0 Replies)
Discussion started by: natasha
0 Replies

6. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

7. UNIX for Dummies Questions & Answers

Finding data value that contains x% of points

Hi, I need help on finding the value of my data that encompasses certain percentage of my total data points (n). Attached is an example of my data, n=30. What I want to do is for instance is find the minimum threshold that still encompasses 60% (n=18), 70% (n=21) and 80% (n=24). manually to... (4 Replies)
Discussion started by: ida1215
4 Replies

8. Shell Programming and Scripting

Grabbing data between 2 points in text file

I have a text file that shows the output of my solar inverters. I want to separate this into sections. overview , device 1 , device 2 , device 3. Each device has different number of lines. but they all have unique starting points. Overview starts with 6 #'s, Devices have 4#'s and their data starts... (6 Replies)
Discussion started by: Mikey
6 Replies

9. UNIX for Dummies Questions & Answers

Stack data from multiple files into one, with variable column files

Hello Gurus, Im new to scripting. Got struck with a file merge issue in Unix. Was looking for some direction and stumbled upon this site. I saw many great posts and replies but couldnt find a solution to my issue. Greatly appreciate any help.. I have three csv files -> Apex_10_Latest.csv,... (1 Reply)
Discussion started by: wamshi
1 Replies

10. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
MARC::Field(3pm)					User Contributed Perl Documentation					  MARC::Field(3pm)

NAME
MARC::Field - Perl extension for handling MARC fields SYNOPSIS
use MARC::Field; # If your system uses wacky control field tags, add them MARC::Field->allow_controlfield_tags('FMT', 'LLE'); my $field = MARC::Field->new( 245, '1', '0', 'a' => 'Raccoons and ripe corn / ', 'c' => 'Jim Arnosky.' ); $field->add_subfields( "a", "1st ed." ); DESCRIPTION
Defines MARC fields for use in the MARC::Record module. I suppose you could use them on their own, but that wouldn't be very interesting. EXPORT
None by default. Any errors are stored in $MARC::Field::ERROR, which $MARC::Record usually bubbles up to $MARC::Record::ERROR. CLASS VARIABLES
extra_controlfield_tags: Some systems (notably Ex Libris's Aleph) throw extra control fields in their MARC (e.g., Aleph's MARC-XML tends to have a "FMT" control field). We keep a class-level hash to track to track them; it can be manipulated with "allow_controlfield_tags" and c<disallow_controlfield_tags>. METHODS
new() The constructor, which will return a MARC::Field object. Typically you will pass in the tag number, indicator 1, indicator 2, and then a list of any subfield/data pairs. For example: my $field = MARC::Field->new( 245, '1', '0', 'a' => 'Raccoons and ripe corn / ', 'c' => 'Jim Arnosky.' ); Or if you want to add a control field (< 010) that does not have indicators. my $field = MARC::Field->new( '001', ' 14919759' ); tag() Returns the three digit tag for the field. indicator(indno) Returns the specified indicator. Returns "undef" and sets $MARC::Field::ERROR if the indno is not 1 or 2, or if the tag doesn't have indicators. allow_controlfield_tags($tag, $tag2, ...) Add $tags to class-level list of strings to consider valid control fields tags (in addition to 001 through 009). Tags must have three characters. disallow_controlfield_tags($tag, $tag2, ...) =head2 disallow_controlfield_tags('*') Revoke the validity of a control field tag previously added with allow_controlfield_tags. As a special case, if you pass the string '*' it will clear out all previously-added tags. NOTE that this will only deal with stuff added with allow_controlfield_tags; you can't disallow '001'. is_controlfield_tag($tag) -- does the given tag denote a control field? Generally called as a class method (e.g., MARC::Field->is_controlfield_tag('001')) is_control_field() Tells whether this field is one of the control tags from 001-009. subfield(code) When called in a scalar context returns the text from the first subfield matching the subfield code. my $subfield = $field->subfield( 'a' ); Or if you think there might be more than one you can get all of them by calling in a list context: my @subfields = $field->subfield( 'a' ); If no matching subfields are found, "undef" is returned in a scalar context and an empty list in a list context. If the tag is a control field, "undef" is returned and $MARC::Field::ERROR is set. subfields() Returns all the subfields in the field. What's returned is a list of list refs, where the inner list is a subfield code and the subfield data. For example, this might be the subfields from a 245 field: ( [ 'a', 'Perl in a nutshell :' ], [ 'b', 'A desktop quick reference.' ], ) data() Returns the data part of the field, if the tag number is less than 10. add_subfields(code,text[,code,text ...]) Adds subfields to the end of the subfield list. $field->add_subfields( 'c' => '1985' ); Returns the number of subfields added, or "undef" if there was an error. delete_subfield() delete_subfield() allows you to remove subfields from a field: # delete any subfield a in the field $field->delete_subfield(code => 'a'); # delete any subfield a or u in the field $field->delete_subfield(code => ['a', 'u']); If you want to only delete subfields at a particular position you can use the pos parameter: # delete subfield u at the first position $field->delete_subfield(code => 'u', pos => 0); # delete subfield u at first or second position $field->delete_subfield(code => 'u', pos => [0,1]); You can specify a regex to for only deleting subfields that match: # delete any subfield u that matches zombo.com $field->delete_subfield(code => 'u', match => qr/zombo.com/); delete_subfields() Delete all subfields with a given subfield code. This is here for backwards compatability, you should use the more flexible delete_subfield(). update() Allows you to change the values of the field. You can update indicators and subfields like this: $field->update( ind2 => '4', a => 'The ballad of Abe Lincoln'); If you attempt to update a subfield which does not currently exist in the field, then a new subfield will be appended to the field. If you don't like this auto-vivification you must check for the existence of the subfield prior to update. if ( $field->subfield( 'a' ) ) { $field->update( 'a' => 'Cryptonomicon' ); } If you want to update a field that has no indicators or subfields (000-009) just call update() with one argument, the string that you would like to set the field to. $field = $record->field( '003' ); $field->update('IMchF'); Note: when doing subfield updates be aware that "update()" will only update the first occurrence. If you need to do anything more complicated you will probably need to create a new field and use "replace_with()". Returns the number of items modified. replace_with() Allows you to replace an existing field with a new one. You need to pass "replace()" a MARC::Field object to replace the existing field with. For example: $field = $record->field('245'); my $new_field = new MARC::Field('245','0','4','The ballad of Abe Lincoln.'); $field->replace_with($new_field); Doesn't return a meaningful or reliable value. as_string( [$subfields] ) Returns a string of all subfields run together. A space is added to the result between each subfield. The tag number and subfield character are not included. Subfields appear in the output string in the order in which they occur in the field. If $subfields is specified, then only those subfields will be included. my $field = MARC::Field->new( 245, '1', '0', 'a' => 'Abraham Lincoln', 'h' => '[videorecording] :', 'b' => 'preserving the union /', 'c' => 'A&E Home Video.' ); print $field->as_string( 'abh' ); # Only those three subfields # prints 'Abraham Lincoln [videorecording] : preserving the union /'. Note that subfield h comes before subfield b in the output. as_formatted() Returns a pretty string for printing in a MARC dump. as_usmarc() Returns a string for putting into a USMARC file. It's really only useful for "MARC::Record::as_usmarc()". clone() Makes a copy of the field. Note that this is not just the same as saying my $newfield = $field; since that just makes a copy of the reference. To get a new object, you must my $newfield = $field->clone; Returns a MARC::Field record. warnings() Returns the warnings that were created when the record was read. These are things like "Invalid indicators converted to blanks". The warnings are items that you might be interested in, or might not. It depends on how stringently you're checking data. If you're doing some grunt data analysis, you probably don't care. SEE ALSO
See the "SEE ALSO" section for MARC::Record. TODO
See the "TODO" section for MARC::Record. LICENSE
This code may be distributed under the same terms as Perl itself. Please note that these modules are not products of or supported by the employers of the various contributors to the code. AUTHOR
Andy Lester, "<andy@petdance.com>" perl v5.10.1 2010-09-09 MARC::Field(3pm)
All times are GMT -4. The time now is 08:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy