02-18-2009
Hi Pistachio,
let me confirm once again...according to your sample..are you looking for the combination like below...
input:
a1 b1 c1 d1
a2 b2 c2 d2
a3 b3 c3 d3
output
a1 b2 c2 d3 (incase if a1=b2, c2=d3)
a2 b3 c1 c2 (incase if a2=b3, c1=c2)..
is that way you need output...
Thanks
Sha
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Everyone,
Here's a snippet of my data:
File 1 = testRef2:
A1BG - 13208 13284
AAA1 - 34758475 34873943
AAAS - 53701240 53715412File 2 = 42MLN.3.bedS2:
13208
13208
13360
13363
13484
13518
13518My awk script:
awk 'NR == FNR{a=$1;next} {$1>=a}{$1<=a}{print... (5 Replies)
Discussion started by: heecha
5 Replies
2. Shell Programming and Scripting
Hi,
Input
7488 7389 chr1.fa chr1.fa
3546 9887 chr5.fa chr9.fa
7387 7898 chrX.fa chr3.fa
7488 7389 chr21.fa chr3.fa
7488 7389 chr1.fa chr1.fa
3546 9887 chr9.fa chr5.fa
7898 7387 chrX.fa chr3.fa
Desired Output
7488 7389 chr1.fa chr1.fa 2
3546 9887 chr5.fa chr9.fa 2... (2 Replies)
Discussion started by: jacobs.smith
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have a file like this
a 1 2
b 2 2
c 2 3
d 4 5
f 5 6
output
a 1 2
c 2 3
d 4 5
f 5 6
Basically, I want to delete the whole line if $2 and $3 are the same. Thanks (5 Replies)
Discussion started by: jacobs.smith
5 Replies
4. Shell Programming and Scripting
I have two files... file1 and file2.
Where columns 1 and 2 of file1 match columns 1 and 2 of file2 I want to create a new file that is all file1 + columns 3 and 4 of file2
:b: Many thanks if you know how to do this.... :b:
file1
31-101 106 0 92
31-101 106 29 ... (2 Replies)
Discussion started by: pelhabuan
2 Replies
5. Shell Programming and Scripting
Hi Friends,
I have the following input file
cat input
chr1 100 200 0.1 0.2 na 1 na nd
chr1 105 200 0.1 0.2 1 1 na 98
chr1 110 290 nf 1 na nd na 1
chr2 130 150 12 3 na 1 na 1
chr3 450 600 nf nf na 10 na nd
chr4 300 330 1 1 10 11 23 34
My requirement is
1. If $6 is na make $7 nd and... (2 Replies)
Discussion started by: jacobs.smith
2 Replies
6. Shell Programming and Scripting
Dear Shell experts,
I have 2 files with structure:
File 1: ID and count
head test_GI_count1.txt
1000094 2
10039307 1
10039641 1
10047177 11
10047359 1
1008555 2
10120302 1
10120672 13
10121776 1
10121865 32
And 2nd file:
head Protein_gi_GeneID_symbol.txt
protein_gi GeneID... (11 Replies)
Discussion started by: smitra
11 Replies
7. Shell Programming and Scripting
Hi all, I know this sounds suspiciously like a homework course; but, it is not.
My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
Discussion started by: mtucker6784
6 Replies
8. Shell Programming and Scripting
Hi all, I'm trying to match the following two files with the code below:
awk -F, 'NR==FNR {a=$0; next} ($12,$4) in a {print $12,$1,a}' OFS="," file4.csv file3.csv
but the code does not print the entire row from file4 in addition to column 12 and 1 of file3.
file4:
o,c,q,co,ov,b... (1 Reply)
Discussion started by: bkane3
1 Replies
9. Shell Programming and Scripting
Hello All,
I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns.
So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
Discussion started by: vikas_trl
7 Replies
10. UNIX for Beginners Questions & Answers
Hi,
i have 2 files , the data i need to match is in masterfile and i need to pull out column 3 from master if column 1 and 2 match and output entire row to new file
I have tried with join and awk and i keep getting blank outputs or same file
is there an easier way than what i am... (4 Replies)
Discussion started by: axis88
4 Replies
LEARN ABOUT NETBSD
esdsample
esdsample(1) User Commands esdsample(1)
NAME
esdsample - play a sample
SYNOPSIS
esdsample [-s hostname:port] [-b] [-d] [-e] [-h] [-m] [-r freq] samplename
DESCRIPTION
The esdsample utility plays a sample using the Enlighted Sound Daemon (esd).
OPTIONS
The following options are supported:
-s hostname:portContact the esd server on hostname at port.
-b Specify that the output should be in 8-bit format. By default, the output is in 16-bit format.
-d Play the sample from file as raw data. The default behavior is to read the data from a sound file (.wav, .au, and so on).
If this option is chosen, samplename is the name of a file.
-e Play the sample from the esd cache. If this option is chosen, samplename is the name of the sample in the cache.
-h Display help text, and exit.
-m Specify that the output should be in mono format. By default, the output is in stereo format.
-r freq Specify that the output rate should be set to freq. By default, the output rate is set to 44.1 kHz.
OPERANDS
The following operands are supported:
samplename The name of the sample to be played. If the -e option is used, samplename is the esd cache name. Otherwise, samplename is
a filename.
EXAMPLES
Example 1: Playing a sample from a file
example% esdsample generic.wav
Example 2: Playing a sample from the esd cache
example% esdsample -e esdctl:generic.wav
(where esdctl:generic.wav is the cache name)
EXIT STATUS
The following exit values are returned:
0 Application exited successfully
>0 Application exited with failure
FILES
The following files are used by this application:
/usr/bin/esdsample Executable for Enlightened Sound Daemon sound sampler.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-audio |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
esdcat(1), esdmon(1), esdplay(1), esdrec(1), esdctl(1), esd-config(1), libesd(3)
NOTES
Written by Brian Cameron, Sun Microsystems Inc., 2003.
SunOS 5.10 8 Jan 2003 esdsample(1)