Sponsored Content
Top Forums Shell Programming and Scripting Getting input data from 2 tables Post 302628311 by guruprasadpr on Monday 23rd of April 2012 09:21:20 AM
Old 04-23-2012
First, we read the contents of File1(NR==FNR) and store in an array(a[i++]=$0). Then, for every entry in the second file, we divide the number by the corresponding array value and print it(print $0/a[j++]).

Guru.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

2. UNIX for Dummies Questions & Answers

extract data from html tables

hi i need to use unix to extract data from several rows of a table coded in html. I know that rows within a table have the tags <tr> </tr> and so i thought that my first step should be to to delete all of the other html code which is not contained within these tags. i could then use this method... (8 Replies)
Discussion started by: Streetrcr
8 Replies

3. Shell Programming and Scripting

Reading data from multiple tables from Oracle DB

Hi , I want to read the data from 9 tables in oracle DB into 9 different files in the same connection instance (session). I am able to get data from one table to one file with below code : X=`sqlplus -s user/pwd@DB <<eof select col1 from table1; EXIT; eof` echo $X>myfile Can anyone... (2 Replies)
Discussion started by: net
2 Replies

4. UNIX Desktop Questions & Answers

Extracting data from tables and storing in a file

Hi I am trying to write a script to extract information from a database and save that info to a csv file. I am using sql, an oracle database I have no idea how to even begin this. Can somebody please help. (8 Replies)
Discussion started by: ladyAnne
8 Replies

5. Shell Programming and Scripting

Shell script for comparing data of tables

Hi, I have two databases with same tables on different servers.I need to check the data content in each table and if something is missing, should print that. I have a tool which takes the snapshot the table structure,index so on and compares with the other server tables snapshot. Now i need... (1 Reply)
Discussion started by: nessj
1 Replies

6. AIX

Extract data from DB2 tables and FTP it to outside company's firewall

Please help me in creating the script in AIX. requirement is; The new component's main function is to extract the data from DB2 tables and company's firewall directly. The component function needs to check the timestamp in the DB2 tables ((CREDAT and CRETIM) with the requested timestamp and... (1 Reply)
Discussion started by: priyanka3006
1 Replies

7. Shell Programming and Scripting

Extracting data from tables......

HOw to extracts data from tables in database. Merges them into one output file. This output file is loaded into another tables in database. (1 Reply)
Discussion started by: nari.bommi
1 Replies

8. Shell Programming and Scripting

Append data by looking up 2 tables for multiple files

I want to lookup values from two different tables based on common columns and append. The trick is the column to be looked up is not fixed and varies , so it has to be detected from the header. How can I achieve this at once, for multiple data files, but lookup tables fixed. The two lookup... (5 Replies)
Discussion started by: ritakadm
5 Replies

9. Shell Programming and Scripting

Script writing for tables with binary data

Hi There, I'm trying to write a simple script that will email me when we have an application job in a certain status that needs human intervention. I've used this script for other tables and it works great. However, this one gives me the warning that there is binary data so it might not. ... (2 Replies)
Discussion started by: Colel2
2 Replies

10. Shell Programming and Scripting

Search last column of INPUT.txt in TABLEs text and add correspond columns to INPUT.txt

Hi dears i use bash shell i have INPUT.txt like this number of columns different in one some row have 12 , some 11 columns see last column INPUT.txt CodeGender Age Grade Dialect Session Sentence Start End Length Phonemic Phonetic 63 M 27 BS/BA TEHRANI 3 4 298320 310050... (2 Replies)
Discussion started by: alii
2 Replies
MakeMethods::Utility::ArraySplicer(3pm) 		User Contributed Perl Documentation		   MakeMethods::Utility::ArraySplicer(3pm)

NAME
Class::MakeMethods::Utility::ArraySplicer - Common array ops SYNOPSIS
use Class::MakeMethods::Utility::ArraySplicer; # Get one or more values $value = array_splicer( $array_ref, $index ); @values = array_splicer( $array_ref, $index_array_ref ); # Set one or more values array_splicer( $array_ref, $index => $new_value, ... ); # Splice selected values in or out array_splicer( $array_ref, [ $start_index, $end_index], [ @values ]); DESCRIPTION
This module provides a utility function and several associated constants which support a general purpose array-splicer interface, used by several of the Standard and Composite method generators. array_splicer This is a general-purpose array accessor function. Depending on the arguments passed to it, it will get, set, slice, splice, or otherwise modify your array. o If called without any arguments, returns the contents of the array in list context, or an array reference in scalar context (or undef). # Get all values $value_ref = array_splicer( $array_ref ); @values = array_splicer( $array_ref ); o If called with a single numeric argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef). # Get one value $value = array_splicer( $array_ref, $index ); o If called with a single array ref argument, sets the contents of the array to match the contents of the provided one. # Set contents of array array_splicer( $array_ref, [ $value1, $value2, ... ] ); # Reset the array contents to empty array_splicer( $array_ref, [] ); o If called with a two arguments, the first undefined and the second an array ref argument, uses that array's contents as a list of indexes to return a slice of the referenced array. # Get slice of values @values = array_splicer( $array_ref, undef, [ $index1, $index2, ... ] ); o If called with a list of argument pairs, each with a numeric index and an associated value, stores the value at the given index in the referenced array. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value. # Set one or more values by index array_splicer( $array_ref, $index1 => $value1, $index2 => $value2, ... ); o If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. # Splice selected values in or out array_splicer( $array_ref, [ $start_index, $count], [ @values ]); The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned. If both numbers are omitted, or are both undefined, they default to containing the entire value array. If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied. The method returns the items that removed from the array, if any. Here are some examples of common splicing operations. # Insert an item at position in the array $obj->bar([3], 'Potatoes' ); # Remove 1 item from position 3 in the array $obj->bar([3, 1], undef ); # Set a new value at position 2, and return the old value print $obj->bar([2, 1], 'Froth' ); # Unshift an item onto the front of the list array_splicer( $array_ref, [0], 'Bubbles' ); # Shift the first item off of the front of the list print array_splicer( $array_ref, [0, 1], undef ); # Push an item onto the end of the list array_splicer( $array_ref, [undef], 'Bubbles' ); # Pop the last item off of the end of the list print array_splicer( $array_ref, [undef, 1], undef ); Constants There are also constants symbols to facilitate some common combinations of splicing arguments: # Reset the array contents to empty array_splicer( $array_ref, array_clear ); # Set the array contents to provided values array_splicer( $array_ref, array_splice, [ 2, 3 ] ); # Unshift an item onto the front of the list array_splicer( $array_ref, array_unshift, 'Bubbles' ); # Shift it back off again print array_splicer( $array_ref, array_shift ); # Push an item onto the end of the list array_splicer( $array_ref, array_push, 'Bubbles' ); # Pop it back off again print array_splicer( $array_ref, array_pop ); SEE ALSO
See Class::MakeMethods for general information about this distribution. See Class::MakeMethods::Standard::Hash and numerous other classes for examples of usage. perl v5.10.1 2004-09-06 MakeMethods::Utility::ArraySplicer(3pm)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy