is there a way with sed to removed more than one set of lines in one line?
so i mean
this will delete lines between ${firstElem},${lastIndex}
i want in the same line to do somethinkg like this (doesn't work so far)
at the same time delete lines between ${firstElem},${lastIndex} and ${secondElem},${lastIndex1}d
if i don't do this in one line.. indexes for the second set change.. and i need to grep for them again.. so it would be really good if i could delete the two sets simulatiously..
thanks a lot
Last edited by Scott; 01-13-2011 at 01:09 PM..
Reason: Code tags, please...
the file contains the follwoing lines
/*
* Copyright (C) 1995-1996 by XXX Corporation. This program
* contains proprietary and confidential information. All rights reserved
* except as may be permitted by prior written consent.
*
* $Id: xxx_err.h,v 1.10 2001/07/26 18:48:34 zzzz $
... (1 Reply)
file1 contains the following data
sssssssssss
firstline
secondline pppppppppp
ssssssssss
Using sed comamnd i am trying to delete firtsline secondline.
so, output should be
sssssssssss
pppppppppp
ssssssssss
I tried in the following the way, but it is not working.
sed ... (9 Replies)
hi i have a long sed command in a csh script that won't fit on 1 line.
how do i break it up correctly over multiple lines?
this doesn't seem to work in csh:
sed -e s/template/$IP.$NN/ \
-e s/NRG/6/ \
-e s/inputf/$IS.$NN/ \
-e s/SHIFT/10.0/ <template.egsinp > $IP.$NN.inp
i get:
sed:... (1 Reply)
:confused:Hi,
I'm relativley new at unix so am having difficulties at the most basic of areas. I am trying using sed to make multiple lines into one line.
For example, i would like:
Mary
had
a
little
lamb
to look like this
Maryhadalittlelamb
so far i have tried
sed... (1 Reply)
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... (1 Reply)
hey guys,
I tried searching but most 'search and replace' questions are related to one liners.
Say I have a file to be replaced that has the following:
$ cat testing.txt
TESTING
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
ENDTESTING
This is the input file: (3 Replies)
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance (9 Replies)
Hi,
I have been stuck in this requirement where my file contains the below format.
20150812170500846959990854-25383-8.0.0
"ABC Report" hp96880
"4952"
20150812170501846959990854-25383-8.0.0 End of run
20150812060132846959990854-20495-8.0.0
"XYZ Report" vg76452
"1006962188"... (6 Replies)
Discussion started by: Chinmaya Kabi
6 Replies
LEARN ABOUT DEBIAN
gjots2docbook
GJOTS2DOCBOOK(1) General Commands Manual GJOTS2DOCBOOK(1)NAME
gjots2docbook - Convert a gjotsfile to DOCBOOK (on stdout)
SYNOPSIS
gjots2docbook -a|-b [ -e ] [ -P ] [ -p ] [ gjotsfile ]
DESCRIPTION
gjots2docbook converts a gjotsfile into DOCBOOK XML.
gjots2docbook uses awk(1) to perform the conversion.
gjots2docbook does not create them so the first element in the file should contain any <bookinfo> or <artheader> element. Similarly, <bib-
liographic> elements are not created. In fact the output is very simplistic with item titles in the gjotsfile being converted to chapter or
section headings in DOCBOOK. There is no reason why your gjotsfile should not contain valid DOCBOOK XML - and that is why the -e and -p op-
tions are provided.
If the file does not start with <?xml ...> then appropriate lines will be added as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE doc_type PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN">
If properly installed, the docbook utilities can then be used to create HTML, man, ps, pdf etc files eg:
gjots2docbook -b ~/.gjotsfile >gjotsfile.xml
docbook2pdf gjotsfile.xml
It may be necessary to fine-tune the docbook formatting to access all features.
OPTIONS -a makes a DOCBOOK article
-b makes a DOCBOOK book
-e don't encode special characters eg < -> <
-p don't change blank lines to </para><para> markers
-P first section is a preface rather than a chapter (book only)
AUTHOR
Written by Bob Hepple <bhepple@freeshell.org>
http://bhepple.freeshell.org/gjots
COPYRIGHT
Copyright (c) 2002 Robert Hepple
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PAR-
TICULAR PURPOSE.
SEE ALSO gjots(1), gjots2html(1), docbook2gjots(1)GJOTS2DOCBOOK(1)