$ ls -1 *SNPtable*
2836_SNPtable_CLC_stringent.txt
2838_SNPtable_CLC_stringent.txt
2840_SNPtable_CLC_stringent.txt
5039_SNPtable_CLC_stringent.txt
$ cat script.pl
use warnings;
use strict;
@ARGV >= 1 or die qq[Usage: perl $0 file1 [file2] [file3] ...\n];
my $suffix_word = qq[Sample];
my $suffix_letter = qq[A];
my $argc = @ARGV;
my @header_in = split /\s+/, scalar <>;
my $header_out = "@header_in[0..2]" . qq[ ];
for ( 1 .. $argc ) {
$header_out .= join( qq[ ], map { $_ . qq[.] . $suffix_word . $suffix_letter } @header_in[3..$#header_in] ) . qq[ ];
++$suffix_letter;
}
printf "%s\n", $header_out;
while ( <> ) {
next if $. == 1;
print;
} continue {
close ARGV if eof;
}
$ perl script.pl
Usage: perl script.pl file1 [file2] [file3] ...
$ perl script.pl 2836_SNPtable_CLC_stringent.txt 2838_SNPtable_CLC_stringent.txt 2840_SNPtable_CLC_stringent.txt 5039_SNPtable_CLC_stringent.txt
chromo pos ref alleles.SampleA refAllele.SampleA refCount.SampleA refFreq.SampleA altAllele.SampleA altCount.SampleA altFreq.SampleA alleles.SampleB refAllele.SampleB refCount.SampleB refFreq.SampleB altAllele.SampleB altCount.SampleB altFreq.SampleB alleles.SampleC refAllele.SampleC refCount.SampleC refFreq.SampleC altAllele.SampleC altCount.SampleC altFreq.SampleC alleles.SampleD refAllele.SampleD refCount.SampleD refFreq.SampleD altAllele.SampleD altCount.SampleD altFreq.SampleD
chr1 30146 A A A 31 100 NA 0 NA
chr1 55217 G G G 2 100 NA 0 NA
chr1 55223 C C C 2 100 NA 0 NA
chr1 55987 C C C 19 100 NA 0 NA
chr1 62138 T T T 114 100 NA 0 NA
chr1 62233 A A A 110 100 NA 0 NA
chr1 64310 A A A 64 100 NA 0 NA
chr1 64321 A A A 17 100 NA 0 NA
chr1 64377 A A A 56 98 NA 1 NA
chr1 30146 A A A 10 100 NA 0 NA
chr1 55217 G G G 2 100 NA 0 NA
chr1 55987 C C C 8 100 NA 0 NA
chr1 62138 T C 0 0 C 10 100
chr1 62233 A A A 34 100 NA 0 NA
chr1 64310 A A A 37 100 NA 0 NA
chr1 64321 A A A 9 100 NA 0 NA
chr1 64377 A A A 27 100 NA 0 NA
chr1 65570 A C 0 0 C 2 100
chr1 30146 A A A 54 100 NA 0 NA
chr1 55217 G A/G 0 0 A 5 55
chr1 55223 C T/C 0 0 T 4 57
chr1 55987 C C C 17 100 NA 0 NA
chr1 56065 T T T 18 90 NA 2 NA
chr1 62138 T T/C T 19 70 C 8 29
chr1 62233 A G/A 0 0 G 16 66
chr1 64310 A A A 28 100 NA 0 NA
chr1 64321 A C 0 0 C 4 100
chr1 30146 A A A 23 100 NA 0 NA
chr1 55217 G G G 2 100 NA 0 NA
chr1 55223 C C C 2 100 NA 0 NA
chr1 55987 C C C 19 100 NA 0 NA
chr1 62138 T C 0 0 C 38 100
chr1 62233 A A A 108 100 NA 0 NA
chr1 64377 A A A 2 100 NA 0 NA
chr1 65570 A A A 3 100 NA 0 NA
chr1 66577 T T T 45 100 NA 0 NA
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)
I'm pretty new to the database world and I've run into a mental block of sorts. I've been unable to find the answer anywhere. Here's my problem: I have several tables and everything is as normalized as possible (as I've been lead to understand normalization.) Normalization has lead to some... (1 Reply)
I've hunted and hunted but nothing seems to apply to what I need. Any help will be much appreciated!
My input file looks like (Unix):
marker,allele1,allele2
RS1002244,1,1
RS1002244,1,3
RS1002244,3,3
RS1003719,2,2
RS1003719,2,4
RS1003719,4,4
Most markers are listed 3 times but a few... (2 Replies)
Hi..
File 1:
1 aa rep
1 dd rep
1 kk rep
2 bb sad
2 ss sad
3 ee dam
File 2
1 apple fruit
2 mango tree
3 lilly flower
output:
1 aaple fruit aa,dd,kk rep (7 Replies)
Say I have two tables like below..
status
HId sName dName StartTime EndTime
1 E E 9:10 10:10
2 E F 9:15 10:15
3 G H 9:17 10:00
logic
Id devName capacity free Line
1 E 123 34 1
2 E 345 ... (3 Replies)
Hi all,
I have a complex (beyond my biological expertise) problem at hand.
I need to merge multiple files into 1 big matrix. Please help me with some code.
Inp1
Ang_0 chr1 98 T A
Ang_0 chr1 352 G A
Ang_0 chr1 425 C T
Ang_0 chr2 ... (1 Reply)
multiple files to load into different tables,
I have a script show below, but this script loads data from txt file into a table,
but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder ,
can we load these files in diff tables (table 1, table2... (0 Replies)
multiple files to load into different tables,
I have a script show below, but this script loads data from txt file into a table,
but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder ,
can we load these files in diff tables (table 1, table2... (1 Reply)
Hi,
Please excuse me , i have searched unix forum, i am unable to find what i expect ,
my query is , i have 2 files of same structure and having 1 similar field/column , i need to merge 2 tables/files based on the one matched field/column (that is field 1),
file 1:... (5 Replies)
Hello All,
just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table.
Can you please suggest why? or any better idea?
export FILE="/abc/autom/file/geo_JOB.csv"
Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies
LEARN ABOUT SUSE
git-merge-index
GIT-MERGE-INDEX(1) Git Manual GIT-MERGE-INDEX(1)NAME
git-merge-index - Run a merge for files needing merging
SYNOPSIS
git merge-index [-o] [-q] <merge-program> (-a | [--] <file>*)
DESCRIPTION
This looks up the <file>(s) in the index and, if there are any merge entries, passes the SHA1 hash for those files as arguments 1, 2, 3
(empty argument if no file), and <file> as argument 4. File modes for the three files are passed as arguments 5, 6 and 7.
OPTIONS --
Do not interpret any more arguments as options.
-a
Run merge against all files in the index that need merging.
-o
Instead of stopping at the first failed merge, do all of them in one shot - continue with merging even when previous merges returned
errors, and only return the error code after all the merges.
-q
Do not complain about a failed merge program (a merge program failure usually indicates conflicts during the merge). This is for
porcelains which might want to emit custom messages.
If git merge-index is called with multiple <file>s (or -a) then it processes them in turn only stopping if merge returns a non-zero exit
code.
Typically this is run with a script calling git's imitation of the merge command from the RCS package.
A sample script called git merge-one-file is included in the distribution.
ALERT ALERT ALERT! The git "merge object order" is different from the RCS merge program merge object order. In the above ordering, the
original is first. But the argument order to the 3-way merge program merge is to have the original in the middle. Don't ask me why.
Examples:
torvalds@ppc970:~/merge-test> git merge-index cat MM
This is MM from the original tree. # original
This is modified MM in the branch A. # merge1
This is modified MM in the branch B. # merge2
This is modified MM in the branch B. # current contents
or
torvalds@ppc970:~/merge-test> git merge-index cat AA MM
cat: : No such file or directory
This is added AA in the branch A.
This is added AA in the branch B.
This is added AA in the branch B.
fatal: merge program failed
where the latter example shows how git merge-index will stop trying to merge once anything has returned an error (i.e., cat returned an
error for the AA file, because it didn't exist in the original, and thus git merge-index didn't even try to merge the MM thing).
AUTHOR
Written by Linus Torvalds <torvalds@osdl.org[1]> One-shot merge by Petr Baudis <pasky@ucw.cz[2]>
DOCUMENTATION
Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org[3]>.
GIT
Part of the git(1) suite
NOTES
1. torvalds@osdl.org
mailto:torvalds@osdl.org
2. pasky@ucw.cz
mailto:pasky@ucw.cz
3. git@vger.kernel.org
mailto:git@vger.kernel.org
Git 1.7.1 07/05/2010 GIT-MERGE-INDEX(1)