09-29-2011
Using sed command to remove multiple instances of repeating headers in one file?
Hi,
I have catenated multiple output files (from a monte carlo run) into one big output file. Each individual file has it's own two line header. So when I catenate, there are multiple two line headers (of the same wording) within the big file. How do I use the sed command to search for the header lines and remove them? Or, is there a way to include this in the cat command (i.e., cat all files, minus the first to lines of each file?)? Thanks so much for your help!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
I am running a script (which compares two directory contents) for which I am getting an output of 70 pages in which few pages are blank so I was able to delete those blank lines.
But I also want to delete the headers present for each page. can any one help me by providing the code... (1 Reply)
Discussion started by: raj_thota
1 Replies
2. Shell Programming and Scripting
Hi experts,
I am new to scripting. I have a requirement as below.
File1:
A|123|NAME1
A|123|NAME2
B|123|NAME3
File2:
C|123|NAME4
C|123|NAME5
D|123|NAME6
1) I have 2 merge both the files.
2) need to do a sort ( key fields are first and second field)
3) remove all the instances... (3 Replies)
Discussion started by: vukkusila
3 Replies
3. Shell Programming and Scripting
Hi,
I'm trying to strip all lines between two headers in a file:
### BEGIN ###
Text to remove, contains all kinds of characters
...
Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c
om/updates/
Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies
4. Shell Programming and Scripting
I want a shell script that will traverse a file system starting at specific path.
And look at all file names for repeating sequences of and remove them from the file name.
The portion of the name that gets removed has to be a repeating sequence of the same characters.
So the script would... (3 Replies)
Discussion started by: z399y
3 Replies
5. UNIX for Dummies Questions & Answers
Hi there,
I have two questions. First, I was wondering how to use sed to remove two header lines or two tail lines. Here I just do the same operation twice...I'm sure there is a better way. Second, and more importantly, is there a better way to have these operations use files other than... (5 Replies)
Discussion started by: mikey11415
5 Replies
6. Shell Programming and Scripting
is there a way with sed to removed more than one set of lines in one line?
so i mean
sed ${firstElem},${lastIndex}d web.xml > web1.xml
this will delete lines between ${firstElem},${lastIndex}
i want in the same line to do somethinkg like this (doesn't work so far)
sed... (3 Replies)
Discussion started by: Poki
3 Replies
7. Shell Programming and Scripting
My file is in a good column format but several lines in the file begin with a zero. I'm in KSH and looking for a command to remove this zero and keep the text next to it. I don't want any of the zeros in the other columns removed.
Below is a snip from the file... all I need to do is remove that... (2 Replies)
Discussion started by: right_coaster
2 Replies
8. Shell Programming and Scripting
Sed replace using same pattern repeating multiple times in a line
I have text like below in a file:
I am trying to replace the above line to following
How can I acheive this?
I am able to do it if the occurrence is for 1 time:
But If I try like below
I am getting like this:
I have to... (4 Replies)
Discussion started by: sol_nov
4 Replies
9. Shell Programming and Scripting
Good evening
Im new at unix shell scripting and im planning to script a shell that removes headers for about 120 files in a directory and each file contains about 200000
lines in average.
i know i will loop files to process each one and ive found in this great forum different solutions... (5 Replies)
Discussion started by: alexcol
5 Replies
10. Shell Programming and Scripting
I have a XML in which <Amt Ccy="EUR">3.1</Amt> tag repeats. This is under another tag <Main>. I need to sum all the values of <Amt Ccy=""> (Ccy may vary) coming under <Main> using awk and or sed command.
can some help?
Sample looks like below
<root>
<Main>
... (6 Replies)
Discussion started by: bk_12345
6 Replies
LEARN ABOUT DEBIAN
isodump
isodump(5) Linux IEEE 1394 isodump(5)
NAME
isodump - format of IEEE 1394 isochronous packets dump file
DESCRIPTION
The isodump format stores a series of IEEE 1394 isochronous stream packets (possibly from multiple channels), including their headers. Its
main use is as the output format of dumpiso(1) and the input format of sendiso(1).
The 32 byte header starts at offset 0 with the string "1394 isodump v1" followed by a zero byte. The next 8 bytes form a 64 bit big endian
integer, which represents a bit mask of the channels that were dumped. A set bit at position (1 << x) signifies that channel x was being
listened on. The following 8 bytes are set to zero.
The iso packets follow the header and are appended to the data stream in the order they were received. The packets consist of the header
quadlet as originally received and the data quadlets following directly. The CRC quadlets after header and data do not appear and every-
thing is in big endian, as seen on the bus.
There is no further framing of the packets in the format, packet boundaries can be found by looking at the data size field in the header
quadlet of each packet. The data size field appears in the most significant 16 bits of the header quadlet, contain the size in bytes (the
actual packet is padded to a multiple of four bytes) and do not include the header packet.
COMPATIBILITY
This format was introduced with the iso send and dump tools distributed with libraw1394. No one else uses it so far.
SEE ALSO
sendiso(1), dumpiso(1)
AUTHOR
Andreas Bombe <aeb@debian.org>
libraw1394 2.0.9 isodump v1 isodump(5)