07-28-2015
thanks ! can the 3rd column be picked up on the fly and not hard-coded ? The reason is I have multiple pairs of files to join..and I want to do them in a loop rather than hardcoding the names...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: reggiej
1 Replies
2. Shell Programming and Scripting
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)
Discussion started by: crimper
5 Replies
3. UNIX for Dummies Questions & Answers
Hello,
My apologies if this has been posted elsewhere, I have had a look at several threads but I am still confused how to use these functions. I have two files, each with 5 columns:
File A: (tab-delimited)
PDB CHAIN Start End Fragment
1avq A 171 176 awyfan
1avq A 172 177 wyfany
1c7k A 2 7... (3 Replies)
Discussion started by: InfoSeeker
3 Replies
4. Shell Programming and Scripting
I am trying to join a few hundred files using join. Is there a way to use while read or something else to automate this. My problem is the following.
Day 1
City Temp
ABC 20
DEF 30
HIJ 15
Day 2
City Temp
ABC 22
DEF 29
KLM 5
Day 3 (3 Replies)
Discussion started by: theFinn
3 Replies
5. UNIX for Dummies Questions & Answers
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)
Discussion started by: shunter0810
0 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt. Each file has 3 columns (2 other columns in addition to the first common column).
I want to write a script to join the files by the first common column so that in the... (5 Replies)
Discussion started by: evelibertine
5 Replies
7. Shell Programming and Scripting
Hello Friends,
I just need a small help, I need an awk program which can join 2 fields of different files which are having one common field into one file.
File - 1
FileName~Size
File- 2
FileName~Date
I need the output file in the following way
O/P- File
FileName~Date~Size
For... (4 Replies)
Discussion started by: abhisheksunkari
4 Replies
8. Shell Programming and Scripting
I have two files,
file1.txt:
1 abc
2 def
2 dgh
3 ijk
4 lmn
file2.txt
1 opq
2 rst
3 uvw
My desired output is:
1 abc opq
2 def rst
2 dgh rst
3 ijk uvw (2 Replies)
Discussion started by: xan.amini
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: aksijain
1 Replies
10. Shell Programming and Scripting
Hi there,
I am trying to join 24 files (i showed example of 3 files below). They all have 2 columns. The first columns is common to all. The files are tab delimited eg
file 1
rs0001 100e-34
rs0003 2.8e-01
rs008 1.9e-90
file 2
rs0001 1.98e-22
rs0004 3.77e-10... (4 Replies)
Discussion started by: fat
4 Replies
LEARN ABOUT OPENSOLARIS
bltocolor_r
bltocolor(3TSOL) Trusted Extensions Library Functions bltocolor(3TSOL)
NAME
bltocolor, bltocolor_r - get character-coded color name of label
SYNOPSIS
cc [flag...] file... -ltsol [library...]
#include <tsol/label.h>
char *bltocolor(const m_label_t *label);
char *bltocolor_r(const m_label_t *label, const int size,
char *color_name);
DESCRIPTION
The bltocolor() and bltocolor_r() functions get the character-coded color name associated with the binary label label.
The calling process must have PRIV_SYS_TRANS_LABEL in its set of effective privileges to get color names of labels that dominate the cur-
rent process's sensitivity label.
RETURN VALUES
The bltocolor() function returns a pointer to a statically allocated string that contains the character-coded color name specified for the
label or returns (char *)0 if, for any reason, no character-coded color name is available for this binary label.
The bltocolor_r() function returns a pointer to the color_name string which contains the character-coded color name specified for the label
or returns (char *)0 if, for any reason, no character-coded color name is available for this binary label. color_name must provide for a
string of at least size characters.
FILES
/etc/security/tsol/label_encodings
The label encodings file contains the classification names, words, constraints, and values for the defined labels of this system.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Obsolete |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe with exceptions |
+-----------------------------+-----------------------------+
These functions are obsolete and retained for ease of porting. They might be removed in a future Solaris Trusted Extensions release. Use
the label_to_str(3TSOL) function instead.
The bltocolor() function returns a pointer to a statically allocated string. Subsequent calls to it will overwrite that string with a new
character-coded color name. It is not MT-Safe. The bltocolor_r() function should be used in multithreaded applications.
SEE ALSO
label_to_str(3TSOL), libtsol(3LIB), attributes(5)
NOTES
The functionality described on this manual page is available only if the system is configured with Trusted Extensions.
If label includes a specified word or words, the character-coded color name associated with the first word specified in the label encodings
file is returned. Otherwise, if no character-coded color name is specified for label, the first character-coded color name specified in the
label encodings file with the same classification as the binary label is returned.
SunOS 5.11 20 Jul 2007 bltocolor(3TSOL)