Sponsored Content
Top Forums Shell Programming and Scripting Fill the Key fields : Please help us Post 302180166 by charandevu on Sunday 30th of March 2008 08:10:43 AM
Old 03-30-2008
Fill the Key fields : Please help us

Hi ....

we are having the below file .Column 1, Column 2 ,column 3 are key fields...
In the below ...for 2 nd , 3 rd row the repeated key column is missing ....

i want the new file to be populated with all missing key columns.


E100,0,5/29/1993,0,E001,E000,A,500000,41666.667,240.384615
_____0,1/23/1994,0,E001,E003,A,125400,10450,60.288462
_____0,6/4/1994,0,E001,E003,A,95000,7916.667,45.673077
E101,0,7/30/1993,0,E001,E003,A,87000,7250,41.826923
______ 1/9/1993,0,E001,E003,A,45200,3766.667,21.730769
E103,0,2/3/1995,0,E001,E003,A,15000,1250,7.211538
E104,0,2/15/1995,0,E001,E001,A,78000,6500,37.5


I want the result to be :


E100,0,5/29/1993,0,E001,E000,A,500000,41666.667,240.384615
E100, 0,1/23/1994,0,E001,E003,A,125400,10450,60.288462
E100, 0,6/4/1994,0,E001,E003,A,95000,7916.667,45.673077
E101,0,7/30/1993,0,E001,E003,A,87000,7250,41.826923
E101,0,1/9/1993,0,E001,E003,A,45200,3766.667,21.730769
E103,0,2/3/1995,0,E001,E003,A,15000,1250,7.211538
E104,0,2/15/1995,0,E001,E001,A,78000,6500,37.5



Please help me ........
 

9 More Discussions You Might Find Interesting

1. Solaris

Esc key/Auto-fill

I'm an HPUX/Linux guy, who appreciates occasionally hitting the Esc key for Auto-fill... Does sunOS have anything like this? This is my 1st post, and I didn't want to waste it :D thanks, manuel (3 Replies)
Discussion started by: mr_manny
3 Replies

2. Shell Programming and Scripting

align several fields and fill spaces with zero

hi all, i have a big problem, and i donīt know what to do. i have a flat file with several fields, which are separated by ";" like this: 5656838-7B;97030000-7;*;V16106133 ;1;1; 4612062-0B;97030000-7;*;C14038149 ;1;2; 8044938-0B;97030000-7;*;V16034219 ;1;2; where B is a blank space. ... (2 Replies)
Discussion started by: DebianJ
2 Replies

3. UNIX for Dummies Questions & Answers

Pressing backspace key simulates enter key

Hi, Whenever i press the backspace key, a new line appears, i.e. it works like a enter key. :confused: Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

4. Shell Programming and Scripting

Matching by key fields

I have a file (key.dat) that contains two columns: AA|1234| BB|567| CC|8910| I have another file (extract.dat) that contains some data: SD|458|John|Smith| AA|3345|Frank|Williams| AA|1234|Bill|Garner| BD|0098|Yu|Lin| BB|567|Gail|Hansen| CC|8910|Ken|Nielsen| I want to compare the... (5 Replies)
Discussion started by: ChicagoBlues
5 Replies

5. Shell Programming and Scripting

Perl function to sort a file based on key fields

Hi, I am new to PERL.I want to sort all the lines in a file based on 1,2 and 4th filelds. Can U suggest me a command/function in perl for this operation.. (5 Replies)
Discussion started by: karthikd214
5 Replies

6. Shell Programming and Scripting

Compare Fields from two text files using key columns

Hi All, I have two files to compare. Each has 10 columns with first 4 columns being key index together. The rest of the columns have monetary values. Using Perl, I want to read one file into hash; check for the key value availability in file 2; then compare the values in the rest of 6... (2 Replies)
Discussion started by: Sangtha
2 Replies

7. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

8. UNIX for Dummies Questions & Answers

Fill fields with awk from an array?

Hi experts, I have been trying for a while to accomplish the following task using awk, and I just don't seem find find a way. I am not particular about using awk, it just seemed like the logical choice at first. I have a file that contains 5 fields that are delimited by a space character.... (1 Reply)
Discussion started by: GermanicGalore
1 Replies

9. Shell Programming and Scripting

Join and merge multiple files with duplicate key and fill void columns

Join and merge multiple files with duplicate key and fill void columns Hi guys, I have many files that I want to merge: file1.csv: 1|abc 1|def 2|ghi 2|jkl 3|mno 3|pqr file2.csv: (5 Replies)
Discussion started by: yjacknewton
5 Replies
Alzabo::Create::ForeignKey(3pm) 			User Contributed Perl Documentation			   Alzabo::Create::ForeignKey(3pm)

NAME
Alzabo::Create::ForeignKey - Foreign key objects for schema creation. SYNOPSIS
use Alzabo::Create::ForeignKey; DESCRIPTION
A foreign key is an object defined by several properties. It represents a relationship from a column or columns in one table to a column or columns in another table. This relationship is defined by its cardinality (one to one, one to many, or many to one) and its dependencies (whether or not table X is dependent on table Y, and vice versa). Many to many relationships are not allowed. However, you may indicate such a relationship when using the Alzabo::Create::Schema->add_rela- tion method method, and it will create the necessary intermediate linking table for you. INHERITS FROM
"Alzabo::ForeignKey" Note: all relevant documentation from the superclass has been merged into this document. METHODS
new The constructor takes the following parameters: * columns_from => "Alzabo::Create::Column" object(s) * columns_to => "Alzabo::Create::Column" object(s) These two parameters may be either a single column or a reference to an array columns. The number of columns in the two parameters must match. * cardinality => [1, 1], [1, 'n'], or ['n', 1] * from_is_dependent => $boolean * to_is_dependent => $boolean * comment => $comment An optional comment. It returns a new "Alzabo::Create::ForeignKey" object. Throws: "Alzabo::Exception::Params" table_from table_to Returns the relevant "Alzabo::Create::Table" object. columns_from columns_to Returns the relevant "Alzabo::Create::Column" object(s) for the property as an array. column_pairs Returns an array of array references. The references are to two column array of "Alzabo::Create::Column" objects. These two columns cor- respond in the tables being linked together. set_columns_from ("Alzabo::Create::Column" object(s)) Sets the column(s) that the relation is from. This can be either a single column object or a reference to an array of column objects. Throws: "Alzabo::Exception::Params" set_columns_to ("Alzabo::Create::Column" object(s)) Sets the column(s) that the relation is to. This can be either a single column object or a reference to an array of column objects. Throws: "Alzabo::Exception::Params" cardinality Returns a two element array containing the two portions of the cardinality of the relationship. Each portion will be either '1' or 'n'. from_is_dependent to_is_dependent Returns a boolean value indicating whether there is a dependency from one table to the other. is_one_to_one is_one_to_many is_many_to_one Returns a boolean value indicating what kind of relationship the object represents. set_cardinality (@cardinality) see above for details Sets the cardinality of the foreign key. Throws: "Alzabo::Exception::Params" set_from_is_dependent ($boolean) Indicates whether or not the first table in the foreign key is dependent on the other (i.e. whether the 'from' table is dependent on the 'to' table). set_to_is_dependent ($boolean) Indicates whether or not the second table in the foreign key is dependent on the other (i.e. whether the 'to' table is dependent on the 'from' table). id Returns a string uniquely identifying the foreign key. is_same_relationship_as ($fk) Given a foreign key object, this returns true if the two objects represent the same relationship. However, the two objects may represent the same relationship from different table's points of view. comment Returns the comment associated with the foreign key object, if any. set_comment ($comment) Sets the comment for the foreign key object. AUTHOR
Dave Rolsky, <autarch@urth.org> perl v5.8.8 2007-12-23 Alzabo::Create::ForeignKey(3pm)
All times are GMT -4. The time now is 04:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy