11-13-2007
Quote:
Originally Posted by
soliberus
It should look something like this:
sed '1,100d' messages > messages.tmp
cat messages.tmp > messages
rm message.tmp
Hi buddy, many thanks for the script. It should work.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how can i delete all lines in file by using "vi" ? (6 Replies)
Discussion started by: strok
6 Replies
2. Shell Programming and Scripting
Dear All,
I m trying to delete two lines at a time in file called 123.txt. Im using sed and based on line numbers i m deleting it and writing it to another file. Follwing i have done.
cat 123.txt | sed '1,5 d' > new
I want to delete line no 1 and 5 at a time, for that i m using... (6 Replies)
Discussion started by: naree
6 Replies
3. UNIX for Dummies Questions & Answers
hello... I have a file with a list of filepaths in it, like so:
delMe.txt (files to be deleted)
./root/index.php
./root/language/se/home.inc.php
./root/language/pl/home.inc.php
Now here's what I'm trying to do. I want any lines in the above file (delMe.txt) to be deleted out of the... (3 Replies)
Discussion started by: jzacsh
3 Replies
4. Solaris
I have a file with 28,00,000 lines of rows in this the first 80 lines will be chunks .
I want to delete the chunks of 80 lines. I tried tail -f2799920 filename.
is there any efficient way to do this.
Thanks in advance. (7 Replies)
Discussion started by: salaathi
7 Replies
5. Shell Programming and Scripting
Input:
a
b
b
c
d
d
I need:
a
c
I know how to get this (the lines that have duplicates) :
b
d
sort file | uniq -d
But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem. (3 Replies)
Discussion started by: necroman08
3 Replies
6. UNIX for Dummies Questions & Answers
Hiiii
I have a file which contains huge data as
a.dat:
PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA
event name: 010990D
time shift: 7.3000
half duration: 5.0000
latitude: 24.4200
longitude: 94.9500
depth: 129.6000
Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies
7. UNIX for Advanced & Expert Users
Hi All,
I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space.
I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies
8. UNIX for Advanced & Expert Users
Hi,
I need a unix command to delete first n (say 100) lines from a log file. I need to delete some lines from the file without using any temporary file. I found sed -i is an useful command for this but its not supported in my environment( AIX 6.1 ). File size is approx 100MB.
Thanks in... (18 Replies)
Discussion started by: unohu
18 Replies
9. Shell Programming and Scripting
Hello,
I have file of more than 10000 lines.
I want to delete 40 lines after every 20 lines.
e.g from a huge file, i want to delete line no from 34 - 74, then 94 - 134 etc and so on.
Please let me know how i can do it.
Best regards, (11 Replies)
Discussion started by: nehashine
11 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have a txt document having a format like this:
DATA1 | DATA2 | DATA3 | 23-JAN-20 23:41:34
DATA1 | DATA2 | DATA3 | 23-JAN-20 23:41:32
DATA1 | DATA2 | DATA3 | 23-JAN-20 23:41:30
...
DATA1 | DATA2 | DATA3 | 23-JAN-20 22:35:31
DATA1 | DATA2 | DATA3 | 23-JAN-20 22:30:34
DATA1 | DATA2 |... (1 Reply)
Discussion started by: gc_sw
1 Replies
LEARN ABOUT DEBIAN
pullupmsg
pullupmsg(9F) Kernel Functions for Drivers pullupmsg(9F)
NAME
pullupmsg - concatenate bytes in a message
SYNOPSIS
#include <sys/stream.h>
int pullupmsg(mblk_t *mp, ssize_t len);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
mp Pointer to the message whose blocks are to be concatenated. mblk_t is an instance of the msgb(9S) structure.
len Number of bytes to concatenate.
DESCRIPTION
pullupmsg() tries to combine multiple data blocks into a single block. pullupmsg() concatenates and aligns the first len data bytes of the
message pointed to by mp. If len equals -1, all data are concatenated. If len bytes of the same message type cannot be found,
pullupmsg() fails and returns 0.
RETURN VALUES
On success, 1 is returned; on failure, 0 is returned.
CONTEXT
pullupmsg() can be called from user or interrupt context.
EXAMPLES
Example 1: Using pullupmsg()
This is a driver write srv(9E) (service) routine for a device that does not support scatter/gather DMA. For all M_DATA messages, the data
will be transferred to the device with DMA. First, try to pull up the message into one message block with the pullupmsg() function (line
12). If successful, the transfer can be accomplished in one DMA job.
Otherwise, it must be done one message block at a time (lines 19-22). After the data has been transferred to the device, free the message
and continue processing messages on the queue.
1 xxxwsrv(q)
2 queue_t *q;
3 {
4 mblk_t *mp;
5 mblk_t *tmp;
6 caddr_t dma_addr;
7 ssize_t dma_len;
8
9 while ((mp = getq(q)) != NULL) {
10 switch (mp->b_datap->db_type) {
11 case M_DATA:
12 if (pullupmsg(mp, -1)) {
13 dma_addr = vtop(mp->b_rptr);
14 dma_len = mp->b_wptr - mp->b_rptr;
15 xxx_do_dma(dma_addr, dma_len);
16 freemsg(mp);
17 break;
18 }
19 for (tmp = mp; tmp; tmp = tmp->b_cont) {
20 dma_addr = vtop(tmp->b_rptr);
21 dma_len = tmp->b_wptr - tmp->b_rptr;
22 xxx_do_dma(dma_addr, dma_len);
23 }
24 freemsg(mp);
25 break;
. . .
26 }
27 }
28 }
SEE ALSO
srv(9E), allocb(9F), msgpullup(9F), msgb(9S)
Writing Device Drivers
STREAMS Programming Guide
NOTES
pullupmsg() is not included in the DKI and will be removed from the system in a future release. Device driver writers are strongly encour-
aged to use msgpullup(9F) instead of pullupmsg().
SunOS 5.10 11 Nov 1996 pullupmsg(9F)