I am trying to use sed to delete multiple lines in a file. The problem is that I need to search for a certain line and then once found delete it plus the next 4 lines. For instance if I had a file that consisted of the following lines:
#Data1.start
(
(Database= data1)
(Name = IPC)... (1 Reply)
Hi everyone,
I have text files that I want to delete lines from. I have searched through this forum for quite some time and found examples of both awk and sed. Unfortunately, I was not able to successfully do what I want. Well to some extent. I did manage to delete the first 15 lines from each... (5 Replies)
Hi,
I have 10 different strings. I have to delete the whole line matching with any one string.
I can use sed like below
sed '/$keyword1/d' fileList.txt > temp_fileList.txt
sed '/$keyword2/d' temp_fileList.txt > temp_fileList1.txt
.
.
.
Here is the problem i do not have fixed number... (9 Replies)
I've got a longish log file with content such as
Uplink traffic:
Downlink traffic:
I want to parse the log file and remove any line that contains the string "Uplink traffic:" at the beginning of the line, but only if the line following it beginnings with the string "Downlink traffic:" (in... (7 Replies)
I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it.
For example, Here is a portion of a zone file.
IN NS ns1.domain.tld.
IN NS ns2.domain.tld.
IN ... (2 Replies)
Hello all,
I'm using the Bash shell on Solaris 8.
Please can someone tell me how I can delete multiple lines in the hosts file?
I have a list of hosts that I want to quickly delete in the hosts file, but I'm looking for a quicker way than using VI to delete the lines one by one.
Regards,... (4 Replies)
Hi Everyone!
I would like ask if there's a better way I can delete multiple lines in a file1 by collecting all criteria from file2.
file1:
a
b
c
d
e
f
file2:
a
e
f
The expected value will be:
b (3 Replies)
Hi,
I'm trying to search for some number and from that line, i need to delete the 5th line exactly.
Eg:
Consider below as text file data:
10000
a
b
c
d
e
.
.
.
10000
w
q
t (8 Replies)
Hi!
I want to delete N (say 10) lines after the line which text is found in a file "A".Also to delete the line in which the text is found.
Only one occurrence of the search string in the file "A"
The text to be deleted is in another text file "B". All the search texts in the file "B" are in... (3 Replies)
Discussion started by: shahid1632
3 Replies
LEARN ABOUT DEBIAN
colorit
COLORIT(1)COLORIT(1)NAME
colorit - a script for markuping the text input
SYNOPSIS
colorit [OPTIONS] [files...]
DESCRIPTION
colorit is a script for markuping text input and sending a result to stdout. Markuping rules are described in a configuration file which
is filtered by preprocessor (the default is m4 ). The define HOME equal to your home directory is set for the preprocessor using -D option
supported by both m4 and cpp. This script can be used for colorizing the text by ANSI escape sequences, or making a simple text conver-
sions and may be used for colorizing output of dict or other programs. In particular, log files, dict, cc, make, or diff output can easily
be colorized and viewed.
OPTIONS -V or --version
Shows version information.
-h or --help
Shows help information.
-c file or --config file
Specify configuration file. The default is ~/.coloritrc or /etc/dictd/colorit.conf
--pp preprocessor
Specify a preprocessor (- for none).
FILES
~/.coloritrc
User's colorit configuration file
/etc/dictd/colorit.conf
System colorit configuration file
CONFIG FILE
Empty lines or lines beginning with sharp sign (`#') are ignored. All other lines have this structure: command arg1 arg2 ... argN. All
commands are processed one-by-one for each input line.
args strings can be surrounded by double-quote characters.
Currently, only mark command is available having the following arguments: regexp pre_string post_string
The pre_string and post_string are inserted at the beginning and the end of substring matched by regular expression regexp
BUGS
The only supported escape sequence in the strings surrounded by double quotes is 33.
SEE ALSO less(1), m4(1), cpp(1), dict(1)
28 Oct 2003 COLORIT(1)