10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a file from which I am trying to delete a particular word on a particular line.
NEW
NEW
/v/engine
NEW
/ifs/list
NEW
/ifs/vdrome
NEW
I am trying to delete the first line only if it contains the word NEW. I am also trying to delete the last line only if it contains the word NEW. I... (11 Replies)
Discussion started by: newbie2010
11 Replies
2. Shell Programming and Scripting
Hi guys, I wonder if it's possible to search for a line containing 2 strings and delete that line and perhaps replace the source file with already deleted line(s).
What I mean is something like this:
sourcefile.txt
line1: something 122344 somethin2 24334 45554676
line2: another something... (6 Replies)
Discussion started by: netrom
6 Replies
3. Shell Programming and Scripting
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)
Discussion started by: vivek d r
14 Replies
4. Shell Programming and Scripting
I have a large data file that I need to edit. There are lines like,
> <IDNUMBER> (ST000002)
> <SUPPLIER> (ST000002)
> <IDNUMBER> (ST000004)
> <SUPPLIER> (ST000004)
and I need to delete everything after the >, excepting the end of line.
> <IDNUMBER>
> <SUPPLIER>
> <IDNUMBER>
> ... (4 Replies)
Discussion started by: LMHmedchem
4 Replies
5. Shell Programming and Scripting
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)
Discussion started by: dvah
1 Replies
6. Shell Programming and Scripting
Hi Geeks :b:,
I need to delete a line from file that contains a particular keyword.
I had read in some forum of unix.com that below code could be used
sed "/$titlesearch/d" movielist >tmp
mv tmp movielist
But my file contains lines which contain slashes (/)
FOr eg:
/etc/movie/title/... (5 Replies)
Discussion started by: ajincoep
5 Replies
7. Shell Programming and Scripting
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)
Discussion started by: gwgreen1
2 Replies
8. Shell Programming and Scripting
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)
Discussion started by: rocketman88
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: one71
2 Replies
10. Shell Programming and Scripting
sed "/$titlesearch/d" movielist
will delete any line in the file movielist that matches $titlesearch, but this is only a screen print correct ?
how can I have sed to actually delete the line from the file so that it doesnt appear next time I open the file ?
thanks
Steffen (8 Replies)
Discussion started by: forever_49ers
8 Replies