09-27-2012
Hi,
I just pasted the sample file.. But I do have common ids from column 1 in 2 files.. I tried to debug the perl code and I see that my split function is not working..
Thanks,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys,
Please guide me if you have a solution to this problem. I have tried paste -s but it's not giving the desired output.
I have a file with the following content-
A123 box1
B345 bat2
C431 my_id
A123 service
C431 box1
A123 my_id
I need two different outputs-
OUTPUT1
A123... (6 Replies)
Discussion started by: smriti_shridhar
6 Replies
2. Shell Programming and Scripting
Hi All,
I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations:
1. I am restrained to 2 input files only.
2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies
3. Shell Programming and Scripting
Hi All,
I do have 2 files
file 1 has 4 tab delimited columns
234 a c dfgyu
294 b g fih
302 c h jzh
328 z c san
597 f g son
File 2 has 2 tab delimted columns
234 23
302 24
597 24
I want to merge file 2 with file 1 based on the data common in both files which is the first column so... (6 Replies)
Discussion started by: Lucky Ali
6 Replies
4. Shell Programming and Scripting
I have n files (for ex:64 files) with one similar column. Is it possible to combine them all based on that column ?
file1
ax100 20 30 40
ax200 22 33 44
file2
ax100 10 20 40
ax200 12 13 44
file2
ax100 0 0 4
ax200 2 3 4 (9 Replies)
Discussion started by: quincyjones
9 Replies
5. Shell Programming and Scripting
Hi experts,
Would you please help me with this?
I have several files and I need to join the forth field of them based on the common first field.
here's an example...
first file:
280346 39.88 -75.08 547.8
280690 39.23 -74.83 538.7
280729 40.83 -75.08 499.2
280907 40.9 -74.4 507.8... (5 Replies)
Discussion started by: GoldenFire
5 Replies
6. Shell Programming and Scripting
Hi all,
I have 3 files with such data
first files
second file
third file
I have to find common entries of first column in two ways
1) between 2 files (2 Replies)
Discussion started by: manigrover
2 Replies
7. UNIX for Dummies Questions & Answers
Hi all,
I'm trying to join two .txt file tab delimitated based on a common column.
File 1
transcript_id gene_id length effective_length expected_count TPM FPKM IsoPct
comp1000201_c0_seq1 comp1000201_c0 337 183.51 0.00 0.00 0.00 0.00
comp1000297_c0_seq1 ... (1 Reply)
Discussion started by: alisrpp
1 Replies
8. Shell Programming and Scripting
Hi,
I have a table to be imported for R as matrix or data.frame but I first need to edit it because I've got several lines with the same identifier (1st column), so I want to sum the each column (2nd -nth) of each identifier (1st column)
The input is for example, after sorted:
K00001 1 1 4 3... (8 Replies)
Discussion started by: sargotrons
8 Replies
9. Shell Programming and Scripting
Hi all,
I've multiple files. In this case 5. Space separated columns. Each file has 12 columns. Each file has 300-400K lines.
I want to get the output such that if a value in column 2 is present in all the files then get all the columns of that value and print it side by side.
Desired output... (15 Replies)
Discussion started by: genome
15 Replies
10. Shell Programming and Scripting
Hello,
I have a file with 2 columns ( tableName , ColumnName) delimited by a Pipe like below . File is sorted by ColumnName.
Table1|Column1
Table2|Column1
Table5|Column1
Table3|Column2
Table2|Column2
Table4|Column3
Table2|Column3
Table2|Column4
Table5|Column4
Table2|Column5
From... (6 Replies)
Discussion started by: nv186000
6 Replies
LEARN ABOUT OPENSOLARIS
semids
semids(2) System Calls semids(2)
NAME
semids - discover all semaphore identifiers
SYNOPSIS
#include <sys/sem.h>
int semids(int *buf, uint_t nids, uint_t *pnids);
DESCRIPTION
The semids() function copies all active semaphore identifiers from the system into the user-defined buffer specified by buf, provided that
the number of such identifiers is not greater than the number of integers the buffer can contain, as specified by nids. If the size of the
buffer is insufficient to contain all of the active semaphore identifiers in the system, none are copied.
Whether or not the size of the buffer is sufficient to contain all of them, the number of active semaphore identifiers in the system is
copied into the unsigned integer pointed to by pnids.
If nids is 0 or less than the number of active semaphore identifiers in the system, buf is ignored.
RETURN VALUES
Upon successful completion, semids() returns 0. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The semids() function will fail if:
EFAULT The buf or pnids argument points to an illegal address.
USAGE
The semids() function returns a snapshot of all the active semaphore identifiers in the system. More may be added and some may be removed
before they can be used by the caller.
EXAMPLES
Example 1 semids() example
This is sample C code indicating how to use the semids() function.
void
examine_semids()
{
int *ids = NULL;
uint_t nids = 0;
uint_t n;
int i;
for (;;) {
if (semids(ids, nids, &n) != 0) {
perror("semids");
exit(1);
}
if (n <= nids) /* we got them all */
break;
/* we need a bigger buffer */
ids = realloc(ids, (nids = n) * sizeof (int));
}
for (i = 0; i < n; i++)
process_semid(ids[i]);
free(ids);
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
ipcrm(1), ipcs(1), Intro(2), semctl(2), semget(2), semop(2), attributes(5)
SunOS 5.11 8 Mar 2000 semids(2)