03-20-2009
excluding two or more groups of strings from printing
sample text:
001 the quick brown fox jumps 987 over a lazy dog
002 the quick brown fox jumps 999 over a lazy dog
003 the quick brown cow jumps 888 over a lazy dog
004 the quick brown fox jumps 777 over a lazy dog
005 the quick brown fox jumps 666 over a lazy cat
i want to do something like:
cat text | egrep -v ""brown fox"|"lazy dog"" (ofcourse this doesn't work)
which should yield:
003 the quick brown cow jumps 888 over a lazy dog
005 the quick brown fox jumps 666 over a lazy cat
TIA,
Marc
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have one file of numbers
4
5
2
...
And another file of strings
aaaaa bbbbb
ccccc ddddd
eeeee ffffff
...
I'd like to print the stings from each line in reverse order with some decoration the number of times listed in the first file
such as:
Yeah bbbbb aaaaa
Yeah bbbbb aaaaa (5 Replies)
Discussion started by: dcfargo
5 Replies
2. Shell Programming and Scripting
I am creating a script to compare definitions and declarations of functions in C code, and report if the arguments are different.
So I need to compare the 2 strings (args of both), how can I do that? (2 Replies)
Discussion started by: bojomojo
2 Replies
3. Windows & DOS: Issues & Discussions
We are using Red Hat. We have a issue like this: We want to print from Linux, to a printer attached to a Windows machine. What we want to print is a PDF. It prints, but the printing starts from the middle of the page. In the report, there is no space at the top but still printing starts from the... (5 Replies)
Discussion started by: rohan69
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
We have a Unix 3.2v5.0.5.
I installed a printer via scoadmin, HP network printer manager with network peripheral name (hostname and ipadres are in /etc/hosts).
This is the configuration file :
Code:
root@sco1 # cat configurationBanner: on:AlwaysContent types: simpleDevice:... (0 Replies)
Discussion started by: haezeban
0 Replies
5. Shell Programming and Scripting
hello all,
I am novice to shell scripting and need your help guys.I have a file called myfile.txt and its contents are shown below :
<project name="device/samsung/crespo" revision="c932ac3b9f8a53a5c433dc7d3cfa2fb5d45a7eb9"/>
<project name="device/samsung/crespo4g"... (7 Replies)
Discussion started by: acdc
7 Replies
6. Homework & Coursework Questions
Florida State University, Tallahassee, FL, USA, Dr. Whalley, COP4342 Unix Tools.
This program takes much of my previous assignment but adds the functionality of printing the concatenated line numbers found within the input.
Sample input from <> operator:
Hello World
This is hello
a sample... (2 Replies)
Discussion started by: D2K
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
Test file below:
$: cat file1
DATE TIME COL1 COL2 COL3 COL4 ID
01/10/2013 0800 100 200 300 401 112
01/31/2013 1000 201 123 345 456 107
03/05/2013 1100 150 789 311 789 109
02/15/2013 1500 199 456 234 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
8. UNIX for Dummies Questions & Answers
Hi
I have a file which is tab-delimited. Now, I'd like to print the lines which have "chr6" string in both first and second columns. Could anybody help? (3 Replies)
Discussion started by: a_bahreini
3 Replies
9. Shell Programming and Scripting
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies
10. UNIX for Beginners Questions & Answers
Hello Everyone ,
Iam a newbie to shell programming and iam reaching out if anyone can help in this :-
I have two files
1) Insert.txt
2) partition_list.txt
insert.txt looks like this :-
insert into emp1 partition (partition_name)
(a1,
b2,
c4,
s6,
d8)
select
a1,
b2,
c4, (2 Replies)
Discussion started by: nubie2linux
2 Replies
LEARN ABOUT DEBIAN
linsert
linsert(3tcl) Tcl Built-In Commands linsert(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
linsert - Insert elements into a list
SYNOPSIS
linsert list index element ?element element ...?
_________________________________________________________________
DESCRIPTION
This command produces a new list from list by inserting all of the element arguments just before the index'th element of list. Each ele-
ment argument will become a separate element of the new list. If index is less than or equal to zero, then the new elements are inserted
at the beginning of the list. The interpretation of the index value is the same as for the command string index, supporting simple index |
arithmetic and indices relative to the end of the list.
EXAMPLE
Putting some values into a list, first indexing from the start and then indexing from the end, and then chaining them together:
set oldList {the fox jumps over the dog}
set midList [linsert $oldList 1 quick]
set newList [linsert $midList end-1 lazy]
# The old lists still exist though...
set newerList [linsert [linsert $oldList end-1 quick] 1 lazy]
SEE ALSO
list(3tcl), lappend(3tcl), lindex(3tcl), llength(3tcl), lsearch(3tcl), lset(3tcl), lsort(3tcl), lrange(3tcl), lreplace(3tcl), string(3tcl) |
KEYWORDS
element, insert, list
Tcl 8.2 linsert(3tcl)