Sponsored Content
Top Forums Shell Programming and Scripting File comparison in UNIX columnwise Post 302906893 by Scrutinizer on Tuesday 24th of June 2014 09:15:54 AM
Old 06-24-2014
Variation without using arrays:
Code:
awk -F, '{s=p=x; getline p<f; split(p,F); for(i=1; i<=NF; i++) if($i!=F[i]) s=s (s?FS:x) i; print NR, s}' f=file2 file1


Last edited by Scrutinizer; 06-24-2014 at 10:39 AM..
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix comparison

I am very new to Unix. What are the similiarities and differences between ScoUnix and AIX5 if any? Where might i find the information? Which is better? (1 Reply)
Discussion started by: NewGuy100
1 Replies

2. Shell Programming and Scripting

rearranging the data in file (from columnwise to rowwise)

Hi I have one file which is having data like 10201 10202 10205 10206 10207 10208 10209 10210 10211 10213 10215 10801 10802 11406 11415 11422 11426 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11530 11604 11608 11611 11717 11718 11719 11722 11725... (3 Replies)
Discussion started by: reldb
3 Replies

3. UNIX for Dummies Questions & Answers

Comparison Unix and Windows file sysytem

i want to know the similarities and disimilarities of Unix and Windows file systems . methods of file , file orgsnization , meaning of file extension , file and disk fragments :confused::confused: (1 Reply)
Discussion started by: localp
1 Replies

4. Shell Programming and Scripting

Comparing files columnwise and print the differences in third file

Hello Everybody!!!!!!!!! Request you to help me with the below mentioned issue: I have 2 files say, File 1: a|4|7 b|3|2 c|8|8 d|8|9 File 2: a|4|6 b|2|2 c|8|8 d|9|8 The third file(output file) should have: Data mismatch in row 1 column 3 Data mismatch in row 2 coumn 2 Data... (3 Replies)
Discussion started by: abhijeet1409
3 Replies

5. Shell Programming and Scripting

Insert records in a file columnwise

Hello everyone!!!!! Need some help on inserting data in a file columnwise. Example: File1: 1|AAA|25|2 5|qqe|20|7 4|wer|31|81 I need to create a second file in which data can be inserted in a columnwise manner i.e. File2: AAA|25|1|2 qqe|20|5|7 wer|31|4|81 The order of columns in... (1 Reply)
Discussion started by: abhijeet1409
1 Replies

6. UNIX for Advanced & Expert Users

Insert records in a file columnwise

Hello everyone!!!!! Need some help on inserting data in a file columnwise. Example: File1: 1|AAA|25|2 5|qqe|20|7 4|wer|31|81 I need to create a second file in which data can be inserted in a columnwise manner i.e. File2: AAA|25|1|2 qqe|20|5|7 wer|31|4|81 The order of columns in... (1 Reply)
Discussion started by: abhijeet1409
1 Replies

7. Shell Programming and Scripting

Parse a File ColumnWise & Delete the Rows

Hi , I have a CSV file that has around 50K records in it. I have to delete all the duplicate rows from the file except one, depending upon data in column4. Lets say there are 3 rows for 'column4data' in the file. I have to retain only that line which has the smallest date value in column2.... (3 Replies)
Discussion started by: Sheel
3 Replies

8. Shell Programming and Scripting

Trim a file columnwise

Hi All, I want to trim each columns leading & trailing (like sql trim function) of a ',' separated file.. I've a file like this.. manab , c gi lucky , home babu , maa I want the output as manab,c gi lucky,home babu,maa A one liner would be a great help. (2 Replies)
Discussion started by: manab86
2 Replies

9. UNIX for Dummies Questions & Answers

Reading Xml file and print the values into the text file in columnwise?

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (4 Replies)
Discussion started by: sravanreddy
4 Replies

10. Shell Programming and Scripting

UNIX file comparison

I have two files which has component name and version number separated by a space cat file1 com.acc.invm:FNS_PROD 94.0.5 com.acc.invm:FNS_TEST_DCCC_Mangment 94.1.6 com.acc.invm:FNS_APIPlat_BDMap 100.0.9 com.acc.invm:SendEmail 29.6.113 com.acc.invm:SendSms 12.23.65 cat file2 ... (8 Replies)
Discussion started by: rakeshtomar82
8 Replies
Bio::LiveSeq::Mutator(3pm)				User Contributed Perl Documentation				Bio::LiveSeq::Mutator(3pm)

NAME
Bio::LiveSeq::Mutator - Package mutating LiveSequences SYNOPSIS
# $gene is a Bio::LiveSeq::Gene object my $mutate = Bio::LiveSeq::Mutator->new('-gene' => $gene, '-numbering' => "coding" ); # $mut is a Bio::LiveSeq::Mutation object $mutate->add_Mutation($mut); # $results is a Bio::Variation::SeqDiff object my $results=$mutate->change_gene(); if ($results) { my $out = Bio::Variation::IO->new( '-format' => 'flat'); $out->write($results); } DESCRIPTION
This class mutates Bio::LiveSeq::Gene objects and returns a Bio::Variation::SeqDiff object. Mutations are described as Bio::LiveSeq::Mutation objects. See Bio::LiveSeq::Gene, Bio::Variation::SeqDiff, and Bio::LiveSeq::Mutation for details. FEEDBACK
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing lists Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Heikki Lehvaslaiho &; Joseph A.L. Insana Email: heikki-at-bioperl-dot-org insana@ebi.ac.uk, jinsana@gmx.net APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ gene Title : gene Usage : $mutobj = $obj->gene; : $mutobj = $obj->gene($objref); Function: Returns or sets the link-reference to a Bio::LiveSeq::Gene object. If no value has ben set, it will return undef Returns : an object reference or undef Args : a Bio::LiveSeq::Gene See Bio::LiveSeq::Gene for more information. numbering Title : numbering Usage : $obj->numbering(); Function: Sets and returns coordinate system used in positioning the mutations. See L<change_gene> for details. Example : Returns : string Args : string (coding [transcript number] | gene | entry) add_Mutation Title : add_Mutation Usage : $self->add_Mutation($ref) Function: adds a Bio::LiveSeq::Mutation object Example : Returns : Args : a Bio::LiveSeq::Mutation See Bio::LiveSeq::Mutation for more information. each_Mutation Title : each_Mutation Usage : foreach $ref ( $a->each_Mutation ) Function: gets an array of Bio::LiveSeq::Mutation objects Example : Returns : array of Mutations Args : See Bio::LiveSeq::Mutation for more information. mutation Title : mutation Usage : $mutobj = $obj->mutation; : $mutobj = $obj->mutation($objref); Function: Returns or sets the link-reference to the current mutation object. If the value is not set, it will return undef. Internal method. Returns : an object reference or undef DNA Title : DNA Usage : $mutobj = $obj->DNA; : $mutobj = $obj->DNA($objref); Function: Returns or sets the reference to the LiveSeq object holding the reference sequence. If there is no link, it will return undef. Internal method. Returns : an object reference or undef RNA Title : RNA Usage : $mutobj = $obj->RNA; : $mutobj = $obj->RNA($objref); Function: Returns or sets the reference to the LiveSeq object holding the reference sequence. If the value is not set, it will return undef. Internal method. Returns : an object reference or undef dnamut Title : dnamut Usage : $mutobj = $obj->dnamut; : $mutobj = $obj->dnamut($objref); Function: Returns or sets the reference to the current DNAMutation object. If the value is not set, it will return undef. Internal method. Returns : a Bio::Variation::DNAMutation object or undef See Bio::Variation::DNAMutation for more information. rnachange Title : rnachange Usage : $mutobj = $obj->rnachange; : $mutobj = $obj->rnachange($objref); Function: Returns or sets the reference to the current RNAChange object. If the value is not set, it will return undef. Internal method. Returns : a Bio::Variation::RNAChange object or undef See Bio::Variation::RNAChange for more information. aachange Title : aachange Usage : $mutobj = $obj->aachange; : $mutobj = $obj->aachange($objref); Function: Returns or sets the reference to the current AAChange object. If the value is not set, it will return undef. Internal method. Returns : a Bio::Variation::AAChange object or undef See Bio::Variation::AAChange for more information. exons Title : exons Usage : $mutobj = $obj->exons; : $mutobj = $obj->exons($objref); Function: Returns or sets the reference to a current array of Exons. If the value is not set, it will return undef. Internal method. Returns : an array of Bio::LiveSeq::Exon objects or undef See Bio::LiveSeq::Exon for more information. change_gene_with_alignment Title : change_gene_with_alignment Usage : $results=$mutate->change_gene_with_alignment($aln); Function: Returns a Bio::Variation::SeqDiff object containing the results of the changes in the alignment. The alignment has to be pairwise and have one sequence named 'QUERY', the other one is assumed to be a part of the sequence from $gene. This method offers a shortcut to change_gene and automates the creation of Bio::LiveSeq::Mutation objects. Use it with almost identical sequnces, e.g. to locate a SNP. Args : Bio::SimpleAlign object representing a short local alignment Returns : Bio::Variation::SeqDiff object or 0 on error See Bio::LiveSeq::Mutation, Bio::SimpleAlign, and Bio::Variation::SeqDiff for more information. create_mutation Title : create_mutation Usage : Function: Formats sequence differences from two sequences into Bio::LiveSeq::Mutation objects which can be applied to a gene. To keep it generic, sequence arguments need not to be Bio::LocatableSeq. Coordinate change to parent sequence numbering needs to be done by the calling code. Called from change_gene_with_alignment Args : Bio::PrimarySeqI inheriting object for the reference sequence Bio::PrimarySeqI inheriting object for the query sequence integer for the start position of the local sequence difference integer for the length of the sequence difference Returns : Bio::LiveSeq::Mutation object change_gene Title : change_gene Usage : my $mutate = Bio::LiveSeq::Mutator->new(-gene => $gene, numbering => "coding" ); # $mut is Bio::LiveSeq::Mutation object $mutate->add_Mutation($mut); my $results=$mutate->change_gene(); Function: Returns a Bio::Variation::SeqDiff object containing the results of the changes performed according to the instructions present in Mutation(s). The -numbering argument decides what molecule is being changed and what numbering scheme being used: -numbering => "entry" determines the DNA level, using the numbering from the beginning of the sequence -numbering => "coding" determines the RNA level, using the numbering from the beginning of the 1st transcript Alternative transcripts can be used by specifying "coding 2" or "coding 3" ... -numbering => "gene" determines the DNA level, using the numbering from the beginning of the 1st transcript and inluding introns. The meaning equals 'coding' if the reference molecule is cDNA. Args : Bio::LiveSeq::Gene object Bio::LiveSeq::Mutation object(s) string specifying a numbering scheme (defaults to 'coding') Returns : Bio::Variation::SeqDiff object or 0 on error _mutationpos2label Title : _mutationpos2label Usage : Function: converts mutation positions into labels Example : Returns : number of valid mutations Args : LiveSeq sequence object _set_DNAMutation Title : _set_DNAMutation Usage : Function: Stores DNA level mutation attributes before mutation into Bio::Variation::DNAMutation object. Links it to SeqDiff object. Example : Returns : Bio::Variation::DNAMutation object Args : Bio::Variation::SeqDiff object See Bio::Variation::DNAMutation and Bio::Variation::SeqDiff. _set_effects Title : _set_effects Usage : Function: Stores RNA and AA level mutation attributes before mutation into Bio::Variation::RNAChange and Bio::Variation::AAChange objects. Links them to SeqDiff object. Example : Returns : Args : Bio::Variation::SeqDiff object Bio::Variation::DNAMutation object See Bio::Variation::RNAChange, Bio::Variation::RNAChange, Bio::Variation::SeqDiff, and Bio::Variation::DNAMutation. _untranslated Title : _untranslated Usage : Function: Stores RNA change attributes before mutation into Bio::Variation::RNAChange object. Links it to SeqDiff object. Example : Returns : Args : Bio::Variation::SeqDiff object Bio::Variation::DNAMutation object See Bio::Variation::RNAChange, Bio::Variation::SeqDiff and Bio::Variation::DNAMutation for details. perl v5.14.2 2012-03-02 Bio::LiveSeq::Mutator(3pm)
All times are GMT -4. The time now is 02:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy