Sponsored Content
Top Forums Shell Programming and Scripting How to remove lines containing strings Post 302535963 by bartus11 on Sunday 3rd of July 2011 11:01:41 AM
Old 07-03-2011
Code:
sed '/,,  ,/d;/rows/d' infile > outfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using AWK see the upper lines and lower lines of the strings??

Hi experts, You cool guys already given me the awk script below- awk '/9366109380/,printed==5 { ++printed; print; }' 2008-09-14.0.log Morever, i have one more things- when i awk 9366109380, i can also see the Upper 3 lines as well as below 5 lines of that string. Line 1.... (3 Replies)
Discussion started by: thepurple
3 Replies

2. Shell Programming and Scripting

Remove matching lines with list of strings

Hi, HP-UX gxxxxxxxc B.11.23 U ia64 3717505098 unlimited-user license I have a file with below pipe separated field values: xxx|xxx|abcd|xxx|xxx|xx xxx|xxx|abcd#123|xxx|xxx|xx xxx|xxx|abcd#345|xxx|xxx|xx xxx|xxx|pqrs|xxx|xxx|xx xxx|xxx|pqrs#123|xxx|xxx|xx The third field has values like... (6 Replies)
Discussion started by: Nanu_Manju
6 Replies

3. Shell Programming and Scripting

different take on common ?: search for two strings and remove lines between them

Thank you for assisting, I've got a partial solution just needs a tweak. Hulk-BASH$ cat somefile.txt oh there is some stuff here some more stuff here START_LABEL stuff I want more stuff I want END_LABEL other stuff here too and even more stuff here too Hulk-BASH$ Hulk-BASH$ sed... (8 Replies)
Discussion started by: laser
8 Replies

4. Shell Programming and Scripting

Grep and delete lines except the lines with strings

Hi I am writing a script which should read a file and search for certain strings 'approved' or 'removed' and retain only those lines that contain the above strings. Ex: file name 'test' test: approved package waiting for approval package disapproved package removed package approved... (14 Replies)
Discussion started by: vj8436
14 Replies

5. Shell Programming and Scripting

Removing empty lines(space) between two lines containing strings

Hi, Please provide shell script to Remove empty lines(space) between two lines containing strings in a file. Input File : A1/EXT "BAP_BSC6/07B/00" 844 090602 1605 RXOCF-465 PDTR11 1 SITE ON BATTERY A2/EXT... (3 Replies)
Discussion started by: sudhakaryadav
3 Replies

6. Shell Programming and Scripting

How to remove unwanted strings?

Hi Guys, Can someone give me a hand on how I can remove unwanted strings like "<Number>" and "</Number>" and retain only the numbers from the input file below. INPUT FILE: <Number>10050000</Number> <Number>1001340001</Number> <Number>1001750002</Number> <Number>100750003</Number>... (8 Replies)
Discussion started by: pinpe
8 Replies

7. Shell Programming and Scripting

Delete lines in file containing duplicate strings, keeping longer strings

The question is not as simple as the title... I have a file, it looks like this <string name="string1">RZ-LED</string> <string name="string2">2.0</string> <string name="string2">Version 2.0</string> <string name="string3">BP</string> I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies

8. Shell Programming and Scripting

Compare one files with strings from another + remove lines

Have two files and want to compare the content of file1 with file2. When matched remove the line. awk 'NR==FNR {b; next} !(b in $0)' file1 file2file1 1. if match 2. removefile2 1. this line has to be removed if match 2. this line has a match, remove 3. this line has no match, no removingThe... (3 Replies)
Discussion started by: sdf
3 Replies

9. Shell Programming and Scripting

Remove lines containing 2 or more duplicate strings

Within my text file i have several thousand lines of text with some lines containing duplicate strings/words. I would like to entirely remove those lines which contain the duplicate strings. Eg; One and a Two Unix.com is the Best This as a Line Line Example duplicate sentence with the word... (22 Replies)
Discussion started by: martinsmith
22 Replies

10. Shell Programming and Scripting

awk to remove lines that do not start with digit and combine line or lines

I have been searching and trying to come up with an awk that will perform the following on a converted text file (original is a pdf). 1. Since the first two lines are (begin with) text they are removed 2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies
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)
All times are GMT -4. The time now is 11:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy