I have a large data file that I need to edit. There are lines like,
and I need to delete everything after the >, excepting the end of line.
I am not completely sure that the > appears only in this place, so I think I need to do something like,
But I have misplaced the list of all of my sed commands and don't remember the syntax, what needs to be escaped, etc.
Help would be appreciated.
LMHmedchem
Last edited by Scrutinizer; 06-18-2012 at 02:40 PM..
Reason: code tags
Hi,
I want to write a sed script which from
batiato:
batiato/giubbe:
pip_b.2.txt
pip_b.3.txt
pip_b.3mmm.txt
bennato:
bennato/peterpan:
123.txt
consoli:
pip_a.12.txt
daniele: (2 Replies)
Please let me know wat would be sed command to delete any partcular line from a file and also moving lines below it to up.
ie wen line #9 is deleted data in line #10 should move to #9 and so on. (2 Replies)
I'm new to using sed and grep commands, but have found them extremely useful. However I am having a hard time figuring this one out:
Delete every line containing the word CEN and the next line as well.
ie. test.txt
blue
324 CEN
green
red
blue
324 CEN
green
red
blue
to produce:... (2 Replies)
Can any one help me how the sed delete only first line command (D) works.
sed -f sedcmds File.txt
In this how the sed delete only first line command (D) works to delete the blank lines appearing more than ones leaving only one blank and deleting others blanks.
While doing step by step when... (2 Replies)
I want to delete a line between selected lines using sed:
e.g. : Between "bus" to "pins", delete lines conaining "signal" word.
Input :
bus
direction
signal new
signal old
pins
signal ok
end
Desired Output:
bus
direction
pins
signal
end (4 Replies)
HI,
Im using the below commmand to delete lines having "(" at the start of a line.
sed -e '/^(/d'
But i need a command to delete lines that has only "(" in it and no other strings.
infile -
asdf
asdf
( asdf
(
asd
outfile (1 Reply)
Hello,
I want to delete all lines with given string in file1 and the string val is dynamic.
Can this be done using sed command.
Sample:
vars="test twinning yellow"
for i in $vars
do
grep $i file1
if
then
echo "Do Nothing"
else
sed `/$i/d` file1
fi
done
Using the above... (5 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Hi.
In need to delete line before and after pattern in file. I came to following commands.
Delete line before
sed -ni '/pattern/{x;d;};1h;1!{x;p;};${x;p;}' /etc/testfile
Delete line after
sed -i '/pattern/{N;s/\n.*//;}' /etc/testfile
Is it possible to merge it in single command? (3 Replies)
hello Team,
I want to delete below linux using sed command but I am getting error.sed -i '/url=/status.cgi?hostgroup=/d' 3
error:sed: -e expression #1, char 32: unknown option to `s'
Could you please help me with correct syntax.
My line contain / character because of that I am getting... (4 Replies)
Discussion started by: ghpradeep
4 Replies
LEARN ABOUT DEBIAN
xmlstarlet
XMLSTARLET(1) xmlstarlet Manual XMLSTARLET(1)NAME
xmlstarlet - command line XML/XSLT toolkit
SYNOPSIS
xmlstarlet [<options>] [<command>] [<cmd-options>]
INTRODUCTION
XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files us-
ing simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.
This set of command line utilities can be used by those who deal with many XML documents on UNIX shell command prompt as well as for auto-
mated XML processing with shell scripts.
OPTIONS --version
Display the version of xmlstarlet.
--help Display help.
COMMANDS
Type: xmlstarlet <command> --help <ENTER> for command help
Available commands include:
ed (or edit)
Edit/update XML document(s).
sel (or select)
Select data or query XML document(s) (XPATH, etc).
tr (or transform)
Transform XML documents(s) using XSLT.
val (or validate)
Validate XML document(s) (well-formed/DTD/XSD/RelaxNG).
fo (or format)
Format XML document(s).
el (or elements)
Display element structure of XML document.
c14n (or canonic)
XML canonicalization.
ls (or list)
List directory as XML.
esc (or escape)
Escape special XML characters.
unesc (or unescape)
Unescape special XML characters.
pyx (or xmln)
Convert XML into PYX format (based on ESIS - ISO 8879).
p2x (or depyx)
Convert PYX into XML.
REFERENCES
XMLStarlet is a command line toolkit to query/edit/check/transform XML documents (for more information see http://xmlstar.source-
forge.net/).
AUTHOR
Mikhail Grushinskiy.
XMLSTARLET(1)