Is it possible to do a join on multiple fields of two files? I am trying to do something like join -t, -1 2,3 -2 2,3 -o 2.1,2.2,2.3,1.3 filea fileb
I want the join to be on columns 2 and 3 of filea and columns 2 and 3 of fileb.
What is hapenning is that the second file that I want to do the join... (1 Reply)
I've looked at the join command which is able to perform what I need on two rows with a common field, however if I have more than two rows I need to join all of them.
Thus I have one file with multiple rows to be joined on an index number:
1 randomtext1
2 rtext2
2 rtext3
3 rtext4
3 rtext5... (5 Replies)
Hi GUYS sorry for putting simple query. I have tried the methods posted previously in this site but I'm unable to join the similar values in different columns of different files.
I used sort -u file1 and join but no use.??
I'm attaching my inputfiles.Plz chek them
I have two files.
1st file... (10 Replies)
Hi, I need help with the join command
I have 2 files that I want to join on multiple fields.
I want to return all records from file 1
I also want empty fields in my joined file if there isn't a match in file 2
I have already sorted them so I know they are in the same order.
file1 ... (0 Replies)
Hi All,
I am looking for an awk script to do the following
Join the fields together only if the first 4 fields are same.
Can it be done with join function in awk??
a,b,c,d,8,,,
a,b,c,d,,7,,
a,b,c,d,,,9,
a,b,p,e,8,,,
a.b,p,e,,9,,
a,b,p,z,,,,9
a,b,p,z,,8,,
desired output:
... (1 Reply)
Dear all,
I 'd like to ask a question. I have two datasets: a.txt (only has one filed, call 'SNP'), b.txt( has thousands of fields, 1st field call 'SNP').
a.txt:
rs9527
rs318567
rs12376
...
b.txt:
rs167893 1 2 0 2 1 2 ...
rs318567 2 0 2 1 2 0 ...
rs12376 0 2 0 2 1 2 ...
I... (2 Replies)
I have an input file like this...
All iI want to do is If the lines are identical except for the last field i want to merge them into single line
input_file
I feel something is nothing
I feel something is everything
apple mango banana
apple mango grapes
I want to get output like this:... (3 Replies)
I have a file with two fields in it delimited by a comma. Some of the first fields are duplicates. I am trying to eliminate any duplicate records in the first field, and combine the second fields in the output file.
For example, if the input is:
Jane,group=A
Bob,group=A
Bob,group=D... (3 Replies)
Hello all,
I want to join 2 tabbed files on the first 2 fields, and filling the missing values with 0. The 3rd column in each file is constant for the entire file.
file1
12658699 ST5 XX2720 0 1 0 1
53039541 ST5 XX2720 1 0 1.5 1
file2 ... (6 Replies)
Discussion started by: sheetalk
6 Replies
LEARN ABOUT DEBIAN
devel::argnames
Devel::ArgNames(3pm) User Contributed Perl Documentation Devel::ArgNames(3pm)NAME
Devel::ArgNames - Figure out the names of variables passed into subroutines.
SYNOPSIS
use Devel::ArgNames;
sub foo {
warn "foo() called with arguments: "
. join(", ", map { defined() ? $_ : "<unknown>" } arg_names(@_) );
}
foo($bar, $gorch, $blah[4]);
DESCRIPTION
When print-debugging code, you will often ind yourself going:
print "$foo is $foo, $bar is $bar"
With this module, you can write a reusable subroutine easily:
sub my_print_vars {
my %vars;
@vars{arg_names()} = @_;
foreach my $var ( keys %vars ) {
warn "$var is $vars{$var}
";
}
}
my_print_vars($foo, $bar);
This module doesn't provide dumping facilities because there are too many to choose from. This is a DIY kit ;-)
EXPORTS
arg_names [ $level ]
This function will return the names associated with the variables found on @_, at the level $level. If $level is not provided
"arg_names"'s caller's caller will be used ("$level == 2" in that case).
VERSION CONTROL
This module is maintained using Darcs. You can get the latest version from <http://nothingmuch.woobling.org/Devel-ArgNames/>, and use
"darcs send" to commit changes.
SEE ALSO
Data::Dumper::Simple, DB, Devel::Caller, Devel::Caller::Perl, PadWalker.
AUTHORS
Ran Eilam
Yuval Kogman <nothingmuch@woobling.org>
COPYRIGHT
Copyright (c) 2007 Yuval Kogman. All rights reserved
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2008-01-02 Devel::ArgNames(3pm)