Hi, Iam new to unix. I have one input file .
Input file :
ID1~Name1~Place1
ID2~Name2~Place2
ID3~Name3~Place3
I need output such that only first column should change to fixed width column of 15 characters of length.
Output File:
ID1<<12 spaces>>Name1~Place1
ID2<<12... (5 Replies)
I have a file having the following entries:
test1 test2 test3
11 22 33
22 44 66
99 99 44
---
I want to add a column so that the above file becomes:
test1 test2 test3 notest
11 22 33 *
22 44 66 *
99 99 44 *
---
Thanks (6 Replies)
Dear All,
I would like to find an automatic way to add a given code which belong to a class at the end of the column , for example this is my input file:
0610009O20Rik
V$VMYB_01 310 (+) 1 0.971 v-Myb
V$EVI1_04 782 (-) 0.763 0.834 Evi-1
V$ELK1_02 1966 (-) 1 0.984 Elk-1... (4 Replies)
Hi, I have a question how to cut the column from non delimited file
This is my file
gene_id ENSG00000223972 transcript_id ENST00000456328 exon_number 1 gene_biotype pseudogene gene_name DDX11L1 transcript_name DDX11L1-002 tss_id TSS26614
gene_id ENSG00000223972 transcript_id ENST00000515242... (1 Reply)
Hi,
I have a data like
Input:
12||34|56|78
Output:
XYZ|12||34|56|78
I tried like this , but it puts it on another line
awk -F "|" ' BEGIN {"XYZ"} {print $0} 'file
Any quick suggessitons in sed/awk ? am using HP-UX (3 Replies)
Hi,
I have a pipe delimited file as below and I need to replace the 2nd column of each line with null values.
1|10/15/2011|fname1|lname1
2|10/15/2012|fname2|lname2
3|10/15/2013|fname3|lname3
Output file:
1||fname1|lname1
2||fname2|lname2
3||fname3|lname3
I tried this
... (2 Replies)
Good evening
I have the below requirements, as I am not an experts in Linux/Unix and am looking for your ideas how I can do this.
I have file called file1 and file2.
I need to get the second column which is text1_random_alphabets and find that in file 2, if it's exists then print the 3rd... (4 Replies)
hi
I have 2 file with more than 10 columns for both
1st file
apple,0,0,0......
orange,1,2,3.....
mango,2,4,5.....
2nd file
apple,2,3,4,5,6,7...
orange,2,3,4,5,6,8...
watermerlon,2,3,4,5,6,abc...
mango,5,6,7,4,6,def.... (1 Reply)
Discussion started by: tententen
1 Replies
LEARN ABOUT FREEBSD
insq
insq(9F) Kernel Functions for Drivers insq(9F)NAME
insq - insert a message into a queue
SYNOPSIS
#include <sys/stream.h>
int insq(queue_t *q, mblk_t *emp, mblk_t *nmp);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
q Pointer to the queue containing message emp.
emp Enqueued message before which the new message is to be inserted. mblk_t is an instance of the msgb(9S) structure.
nmp Message to be inserted.
DESCRIPTION
insq() inserts a message into a queue. The message to be inserted, nmp, is placed in q immediately before the message emp. If emp is NULL,
the new message is placed at the end of the queue. The queue class of the new message is ignored. All flow control parameters are updated.
The service procedure is enabled unless QNOENB is set.
RETURN VALUES
insq() returns 1 on success, and 0 on failure.
CONTEXT
insq() can be called from user or interrupt context.
EXAMPLES
This routine illustrates the steps a transport provider may take to place expedited data ahead of normal data on a queue (assume all M_DATA
messages are converted into M_PROTO T_DATA_REQ messages). Normal T_DATA_REQ messages are just placed on the end of the queue (line 16).
However, expedited T_EXDATA_REQ messages are inserted before any normal messages already on the queue (line 25). If there are no normal
messages on the queue, bp will be NULL and we fall out of the for loop (line 21). insq acts like putq(9F) in this case.
1 #include
2 #include
3
4 static int
5 xxxwput(queue_t *q, mblk_t *mp)
6 {
7 union T_primitives *tp;
8 mblk_t *bp;
9 union T_primitives *ntp;
10
11 switch (mp->b_datap->db_type) {
12 case M_PROTO:
13 tp = (union T_primitives *)mp->b_rptr;
14 switch (tp->type) {
15 case T_DATA_REQ:
16 putq(q, mp);
17 break;
18
19 case T_EXDATA_REQ:
20 /* Insert code here to protect queue and message block */
21 for (bp = q->q_first; bp; bp = bp->b_next) {
22 if (bp->b_datap->db_type == M_PROTO) {
23 ntp = (union T_primitives *)bp->b_rptr;
24 if (ntp->type != T_EXDATA_REQ)
25 break;
26 }
27 }
28 (void)insq(q, bp, mp);
29 /* End of region that must be protected */
30 break;
. . .
31 }
32 }
33 }
When using insq(), you must ensure that the queue and the message block is not modified by another thread at the same time. You can achieve
this either by using STREAMS functions or by implementing your own locking.
SEE ALSO putq(9F), rmvq(9F), msgb(9S)
Writing Device Drivers
STREAMS Programming Guide
WARNINGS
If emp is non-NULL, it must point to a message on q or a system panic could result.
SunOS 5.10 9 Jul 2001 insq(9F)