Sponsored Content
Top Forums Shell Programming and Scripting How to print file without few exactly matching lines? Post 302387387 by Scott on Friday 15th of January 2010 02:15:17 PM
Old 01-15-2010
Perhaps like...
Code:
grep -Ev "1875 1876 12725 12723|5943 5944 8232 8230" input_file

If you have a lot of lines to exclude, put them in a separate file, then
Code:
grep -vf exclude_file input_file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I want to print next 3 lines after pattern matching.

Dear Experts, I have file called file1 in which i am greping a pattern after that i want to next 3 lines when that pattern is matched. Ex:- file1 USA UK India Africa Hello Asia Europe Australia Hello Peter Robert Jo i want to next 3 lines after matching Hello... (12 Replies)
Discussion started by: naree
12 Replies

2. Shell Programming and Scripting

AIX equivalent to GNU grep's -B and -A [print lines after or before matching lines]

Hi folks I am not allowed to install GNU grep on AIX. Here my code excerpt: grep_fatal () { /usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP" } Howto the same on AIX based machine? from manual GNU grep ‘--after-context=num’ Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

3. Shell Programming and Scripting

Print lines matching value(s) in other file using awk

Hi, I have two comma separated files. I would like to see field 1 value of File1 exact match in field 2 of File2. If the value matches, then it should print matched lines from File2. I have achieved the results using cut, paste and egrep -f but I would like to use awk as it is efficient way and... (7 Replies)
Discussion started by: SBC
7 Replies

4. Shell Programming and Scripting

Print matching lines in a file

Hello everyone, I have a little script below: die "Usage infile outfile reGex" if @ARGV != 3; ($regex) = @ARGV; open(F,$ARGV) or die "Can't open"; open(FOUT,"+>$ARGV") or die "Can't open"; while (<F>) { print FOUT if /$regex/.../$regex/; } No matter what I give $regex on the... (2 Replies)
Discussion started by: new bie
2 Replies

5. Shell Programming and Scripting

print lines between 2 matching patterns

Hi Guys, I have file like below, I want to print all lines between test1231233 to its 10 occurrence(till line 41) test1231233 qwe qwe qweq123 test1231233 qwe qwe qweq23 test1231233 qwe qwe qweq123 test1231233 qwe qwe qweq123131 (3 Replies)
Discussion started by: jagnikam
3 Replies

6. Shell Programming and Scripting

Look up between 2 files and print matching lines

Hi, I have 2 large log files in .gz format file 1 contains abcde 12345 23456 . . . . . . . . 09123 (8 Replies)
Discussion started by: aravindj80
8 Replies

7. Shell Programming and Scripting

How to print all the lines after pattern matching?

I have a file that contains... Number -------------------- 1 2 3 4 i want to print all the numbers after the hyphen ... (6 Replies)
Discussion started by: ankitknit
6 Replies

8. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

9. Shell Programming and Scripting

Want to print out lines with a matching pattern from file

Hi all, I want to search for strings in file1 that can be found in file2 and print out the whole line when matching pattern is found. I have used the below command, but this is not working for me, because it is writing out only the matching patterns from file2, not the whole line. fgrep -o... (2 Replies)
Discussion started by: MonikaB
2 Replies

10. Shell Programming and Scripting

Print lines after matching two pattern

would like to print everything after matching two patterns AAA and BBB. output : CCC ZZZ sample data : AAA BBB CCC ZZZ (4 Replies)
Discussion started by: jhonnyrip
4 Replies
remove element(1m)														remove element(1m)

NAME
remove element - Removes selected elements from a profile SYNOPSIS
rpccp remove element profile-entry-name {-d | -i if-id -m member | -a annotation} [-s syntax] OPTIONS
Removes the default profile element. With the -d option, the -a, -i, and -m options are ignored. Defines an interface identifier for the profile element to be removed for a member specified with the -m option. Only one interface and member pair can be removed in a single operation. If you supply multiple instances of the -i option, the command uses the final instance. The -i and -m options take precedence over the -a option. However, if the default profile element is specified (by the -d option), the -i and -m options are ignored. The interface identifier value has the following form: interface-uuid,major-version.minor-version The UUID is a hexadecimal string and the version numbers are decimal strings, for example: -i ec1eeb60-5943-11c9-a309-08002b102989,1.1 Leading zeros in version numbers are ignored. Defines a member name for the profile element to be removed. This option is required if the interface identifier is specified. Only one interface and member can be removed in a single operation. If you supply multiple instances of the -m option, the command uses the final instance. Removes all elements whose annotation fields match the specified annotation; in the presence of -d option or -i and -m options, the -a option is ignored. Note that the shell supports quotation marks around the annotation field of profile elements, which allows you to include internal spaces in an annotation; the control program does not. To specify or refer to annotations from within the control program, limit each annotation to an unbroken alphanumeric string; for example, CalendarGroup. To refer to annotations from the system prompt, do not incorporate quota- tion marks into any annotation. Indicates the name syntax of the entry name (optional). The only value for this option is the dce name syntax, which is the default name syntax. Until an alternative name syntax becomes available, specifying the -s option is unnecessary. ARGUMENTS
Indicates the name of the target profile. For an entry in the local cell, you can omit the cell name and specify only the cell-relative name. DESCRIPTION
The remove element command removes an element from a profile in the name service database. For a description of the fields in a profile element, see add entry(1m). The remove element command requires the entry name of the profile. The command also requires one of the following options: The default pro- file option takes precedence over the other two options. interface-id -m member-name An interface and member pair takes precedence over the -a option. The annotation option takes effect only if neither the -d or -i option is specified. Privilege Required You need read permission and write permission to the CDS object entry (the target profile entry). NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLES
The initial shell commands set up an environment variable Calendar_1_1, which represents the interface identifier of an RPC interface. The control program commands set up an environment variable for the interface identifier of the Calendar Version 1.1 RPC interface, run RPCCP, and remove an element from a profile, as follows: $ Calendar_1_1=ec1eeb60-5943-11c9-a309-08002b102989,1.1 $ export Calendar_1_1 $ rpccp rpccp> remove element -i Calendar_1_1 > -m /.:/LandS/anthro/Calendar_group > /.:/LandS/anthro/molly_o_profile RELATED INFORMATION
Commands: add element(1m), remove profile(1m), show profile(1m) remove element(1m)
All times are GMT -4. The time now is 07:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy